Char[] theString="Text string".ToCharArry();
reverse_string(theString);int C++char* constString={"Test Sring"};
char* theString=new char{strlen(constString)+1};reverse_string(theString);
reverse_string(theString);int C++char* constString={"Test Sring"};
char* theString=new char{strlen(constString)+1};reverse_string(theString);
String source = "Text string";
public String reverse_string(String source){
if(source == null || source.trim().equals("")){
return source;
}
StringBuffer result = new StringBuffer();
for(int i = source.length() - 1;i >= 0;i--){
result.append(source.charAt(i));
}
return result.toString();}