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 dodrian 2007-03-04 16:31:24
It returns an array of strings separated by the ".". So,

"first.last" => {"first", "last"}
"first.i.last" => {"first", "i", "last"}

I think you could also use a StringTokenizer

Note: The argument past to .split() is actually a regular expression. I'm not sure if "." is a special character in a regular expression, if it is, you might need to escape it.
[ Reply ]
    Yes, it is... "\\." escapes it. by MrTrick2007-03-04 16:37:56
      This may be using a sledgehammer to crack a nut by dodrian2007-03-04 16:46:10
        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
      I like the C method of doing this. by fudje2007-03-04 23:03:54
        MODS! by ToLazyToThink2007-03-04 23:35:07

 

[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.)