The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
August 2001

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

Reverse

Posted by Michael Barry on August 12, 2001 at 7:03 PM

public class StringReverse
{
String xx="abcd";
int lgn=xx.length();
String yy="~";

String twistIt(){
for(int i=1;iyy+=xx.substring(lgn-i,lgn-i+1);
return yy;
}

public static void main(String[] args){
StringReverse blah=new StringReverse();
System.out.print(blah.twistIt());
}
}

cheers M.B.



Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us