• Post Reply Bookmark Topic Watch Topic
  • New Topic

Walk throw string  RSS feed

 
Lio Liov
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to walk throw this string,and replace the parts with uppercase
Could you tell me how can I loop to the end of the string
Thanks
"We are living in a <upcase>yellow submarine</upcase>. We don't have <upcase>anything</upcase> else."
 
Jeff Verdegan
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you thought about how you would do it "by hand"? If not, you need to.

Have you looked at String's javadocs for methods that might help you with the various steps of your "by hand" process (once you get that figured out in detail)? If not, you need to.

In general, you'll need to ShowSomeEffort(⇐click) and TellTheDetails(⇐click) about what exactly you tried and what specific trouble you're having.
 
Carl Ross
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I Believe you want the toUpperCase method


I think this is what you want but you didn't give much detail
 
Campbell Ritchie
Marshal
Posts: 56562
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You do realise you cannot change the contents of a String? You can only replace it with a different String. You are better off using a StringBuilder[←link], which is designed for rapid changes
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!