- 积分
- 26254
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2011-11-7
- 最后登录
- 1970-1-1

|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
如下字符串:
strR="returnCode="0" returnMessage="Query Succeed" rowCount="50" colCount="3" requestParams="minstaid=xxxxx&limitcnt=50×=20190217000000&datacode=xxxxxxxx&maxstaid=xxxxxxx&elements=Station_Name,Station_Id_C,PRE_3h"
我提取数字的代码如下:
String[] strData = strR.Split (new string[] { "\r\n" }, StringSplitOptions.None);
String[] strRowCol= strData[0].Split(new string[] { "Count=" }, StringSplitOptions.None);
String[] strRow = strRowCol[1].Split(new string[] { " " }, StringSplitOptions.None);
String[] strCol = strRowCol[2].Split(new string[] { " " }, StringSplitOptions.None);
String sRow = System.Text.RegularExpressions.Regex.Replace(strRow[0], @"[^0-9]+", "");//取得“50”
String sCol = System.Text.RegularExpressions.Regex.Replace(strCol[0], @"[^0-9]+", "");//取得“3”
各位大侠,还有其它快速取出字符串中: rowCount="50" colCount="3" 数字50 和3吗?
|
|