Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how can we assign a text in front text.

 
Dhanushanth Dhanu
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

normally we can add any string through concat behind the text
but my question is how can we add any string in front of the text?
like i need an out put like this "break Helloworld"
please any one give me an answer.
 
Abimaran Kugathasan
Ranch Hand
Posts: 2066
Clojure IntelliJ IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you find any method in the String API? You should try to make your own method.
 
Ankit Garg
Sheriff
Posts: 9528
33
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
String objects are immutable i.e. they are not meant to be modified in the way you want. This is why there are StringBuffer and StringBuilder classes...
 
Dhanushanth Dhanu
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Abimaran Kugathasan wrote:Did you find any method in the String API? You should try to make your own method.

no sir i didn't see any method for that but what I'm asking is do we have any keyword for that like concat()
 
Dhanushanth Dhanu
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ankit Garg wrote:String objects are immutable i.e. they are not meant to be modified in the way you want. This is why there are StringBuffer and StringBuilder classes...

Yes sir i know that string objects are immutable.so can we do that with StringBuffer or StringBuilder classes? i mean that what i asked above
 
Abimaran Kugathasan
Ranch Hand
Posts: 2066
Clojure IntelliJ IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dhanushanth Dhanu wrote:no sir i didn't see any method for that but what I'm asking is do we have any keyword for that like concat()

cancat() isn't a keyword, it's a method of String class. And have a look on this method of StringBuffer class
 
Dhanushanth Dhanu
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Abimaran Kugathasan wrote:
Dhanushanth Dhanu wrote:no sir i didn't see any method for that but what I'm asking is do we have any keyword for that like concat()

cancat() isn't a keyword, it's a method of String class. And have a look on this method of StringBuffer class


thank you sir.
 
Ankit Garg
Sheriff
Posts: 9528
33
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For god's sake don't call me sir
 
Simone Aiello
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dhanushanth Dhanu wrote:
normally we can add any string through concat behind the text
but my question is how can we add any string in front of the text?
like i need an out put like this "break Helloworld"
please any one give me an answer.


Did you try with

?
 
Abimaran Kugathasan
Ranch Hand
Posts: 2066
Clojure IntelliJ IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ankit Garg wrote:For god's sake don't call me sir

I repeat it!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic