Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/18.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Regex 如何删除查询字符串?从图像url vb.net_Regex_Vb.net_Query String - Fatal编程技术网

Regex 如何删除查询字符串?从图像url vb.net

Regex 如何删除查询字符串?从图像url vb.net,regex,vb.net,query-string,Regex,Vb.net,Query String,从图像url中删除查询字符串(问号变量)的最佳方法是什么 假设我有一个好的形象,比如 $\u 12.JPG?设置\u id=88000500F 但是我不能在不添加一堆无用的检查代码的情况下正确保存它,因为它后面有查询字符串垃圾 我只需要 $\u 12.JPG 寻找适当的正则表达式来处理这个问题,这样我就可以用blank替换它。它可能足够简单,不必担心正则表达式 这将有助于: Dim cleaned = url.Substring(0, url.IndexOf("?"c)) 谢谢,还需要用ind

从图像url中删除查询字符串(问号变量)的最佳方法是什么

假设我有一个好的形象,比如 $\u 12.JPG?设置\u id=88000500F 但是我不能在不添加一堆无用的检查代码的情况下正确保存它,因为它后面有查询字符串垃圾

我只需要 $\u 12.JPG


寻找适当的正则表达式来处理这个问题,这样我就可以用blank替换它。

它可能足够简单,不必担心正则表达式

这将有助于:

Dim cleaned = url.Substring(0, url.IndexOf("?"c))

谢谢,还需要用indexof条件if语句包装它以检查是否?即使存在,也会出错。这就是为什么我喜欢regex的,但这似乎更好,谢谢,我听说这比regex快。(我由此判断)更多的答案在