开发者

RegEx ignore in java

开发者 https://www.devze.com 2022-12-13 20:04 出处:网络
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 t开发者_如何学Pythonhe string after using .replaceAl

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 t开发者_如何学Pythonhe string after using .replaceAll() in JAVA.


replaceAll(";.*", "");


yourString.substring(0, yourString.indexOf(';'))

0

精彩评论

暂无评论...
验证码 换一张
取 消