Computer Science, asked by AADARSH2397, 1 month ago

swap two letter in a string​

Answers

Answered by bhuyanayush2008
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