This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Interesting string methods

 
Sarma Lolla
Ranch Hand
Posts: 203
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Except the last two every thing else prints true.
[CODE]
public static void main(String [] args) {
System.out.println("String".substring(0)=="String");
System.out.println("String".substring(0,6)=="String");
System.out.println("String".replace('t','t')=="String");
System.out.println("String".replace('T','t')=="String");
System.out.println("String".toString()=="String");
System.out.println("String".replace('t','T')=="String".replace('t','T'));
System.out.println(" String ".toString()=="String");
}
[CODE]
 
Jasper Vader
Ranch Hand
Posts: 284
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i guess cos the last two are the only two in which an actual change takes place? (t goes to T, the white space gets removed)...
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic