简体   繁体   English

相当于正则表达式的java替换字符串中所有字符,直到特定字符为止

[英]java equivalent for regex to replace all characters up to a specific character in a string

I am trying to find the java equivalent of doing the following string manipulation (vb.net): 我试图找到做以下字符串操作(vb.net)的Java等效项:

   linkUrl = Regex.Replace(linkUrl, ".*url=", "")

Basically strip all characters up to and including the one provided. 基本上除去所有字符,包括提供的字符。 Also are there any known examples anyone can provide for similar regular expressions used in java. 也有任何已知的示例,任何人都可以提供java中使用的类似正则表达式。

你可以做

linkUrl = linkUrl.replaceAll(".*url=", "");

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM