Tag Archives: java strings

Write a Java Program to Swap two strings without using temp variable

Java Program to Swap two strings To swap two string variables without using third or temp variable, we use substring() method  or replace() method of String class. substring() method has two overloaded forms :- 1) substring(int beginIndex) It returns substring of a calling string starting with the character at the specified index and ending with the last character… Read More »