-3
如何刪除字符串並獲取整數?我有一個字符串(0203400084275255G1Department),我只需要(0203400084275255)
我有一個字符串(020340084275254G1Department)
我需要得到(020340084275254)僅
如何刪除字符串並獲取整數?我有一個字符串(0203400084275255G1Department),我只需要(0203400084275255)
我有一個字符串(020340084275254G1Department)
我需要得到(020340084275254)僅
使用正則表達式。
var test = "(020340084275254G1Department)";
test = new Regex("[^0-9()]").Replace(test, "");
,瞭解運行例子在這裏:https://dotnetfiddle.net/Dkw6g4
搜索正則表達式,並用它來獲得子無字母 –
請加那你嘗試或檢查http://stackoverflow.com/help提出問題 – prasun