如何删除包括字符在内的所有内容 [英] How to remove everything before and including character

查看:60
本文介绍了如何删除包括字符在内的所有内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

dgdfjfirirr.123486586343434

dgdfjfirirr.123486586343434

我如何只返回数字

期间之前和期间之后的价值可能有多个长度

The value before the period and after the period could have multiple lengths

也可能有多个期间..比如dgdfjfirirr.12348658634.3434

also there could be multiple periods..like dgdfjfirirr.12348658634.3434

我需要退货

12348658634.3434

12348658634.3434

www.helixpoint.com

www.helixpoint.com

推荐答案

Hello  Helixpoint,

Hello Helixpoint,

有一种方法可以使用正则表达式来解析字符串。

There is a way to parse string by using regex.

 String s = "dgdfjfirirr.12348658634.3434dasdasdsad12344231";
            MatchCollection vMatches = Regex.Matches(s, "[0-9]+(\\.?[0-9]+)?");
            foreach (Match m in vMatches) {
                var a = m.Value;
            }    

祝你好运,

feih_7


这篇关于如何删除包括字符在内的所有内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆