The Daily Static
  The Daily Static
UF Archives
Register
UF Membership
Ad Free Site
Postcards
Community

Geekfinder
UFie Gear
Advertise on UF

Forum Rules
& FAQ


Username

Password


Create a New Account

 
 

Back to UserFriendly Strip Comments Index

Java string manipulation.. by MrTrick2007-03-04 16:23:05
  stringname.split("."); by dodrian2007-03-04 16:31:24
    Yes, it is... "\\." escapes it. by MrTrick2007-03-04 16:37:56
      This may be using a sledgehammer to crack a nut by dodrian 2007-03-04 16:46:10
But you could use the .toCharArray() method, capitalize the first letter of the array by adding 'A' - 'a' (probably 26), then using the String constructor which take a char array as an argument.

Alternatively with a string 's' you could probably do this:
s = s.replaceFirst(s.substring(0,1), (s.substring(0,1)).toUpperCase());

Thinking about it, I like my second idea better.
[ Reply ]
        Thanks, I ended up with this: by MrTrick2007-03-04 17:00:16
        Don't add 'A' - 'a' by fudje2007-03-04 22:43:18
          Don't add OR by Matthias2007-03-05 02:41:02

 

[Todays Cartoon Discussion] [News Index]

Come get yer ARS (Account Registration System) Source Code here!
All images, characters, content and text are copyrighted and trademarks of J.D. Frazer except where other ownership applies. Don't do bad things, we have lawyers.
UserFriendly.Org and its operators are not liable for comments or content posted by its visitors, and will cheerfully assist the lawful authorities in hunting down script-kiddies, spammers and other net scum. And if you're really bad, we'll call your mom. (We're not kidding, we've done it before.)