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,
4 hours ago
Math,
4 hours ago
Geography,
7 hours ago
Social Sciences,
7 hours ago
Political Science,
8 months ago