• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Walk throw string

 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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."
 
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Marshal
Posts: 79239
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic