swap two letter in a string
Answers
Answered by
1
Answer:
Explanation:
String originalString = "abcde";
char[] c = originalString. toCharArray();
char temp = c[0];
c[0] = c[1];
c[1] = temp;
String swappedString = new String(c);
Similar questions
Math,
15 days ago
Geography,
1 month ago
Social Sciences,
1 month ago
Political Science,
9 months ago