Reputation: 13
Hi i've got a String like "DE32424;WV424324;FR234324;DE45345"
How would I ignore everything after the first ; so only DE32424 would be left in the string after using .replaceAll() in JAVA.
Upvotes: 1
Views: 249
Reputation: 67820
yourString.substring(0, yourString.indexOf(';'))
replaceAll(";.*", "");
Upvotes: 2