→ VVll:所以儀器軟體產生出來的文字格式 你能不能控制,可以的話 06/25 23:36
→ VVll:就產出xml 06/25 23:36
→ VVll:不然用string.split(new string[]{":"}) 以":"作切割 06/25 23:38
→ VVll:或者逐行去讀資料,用":"切key跟vlaue 06/25 23:39
推 fdvd:如果說 輸出的欄位都一樣 譬如一樣是那五個欄位 以Width來 06/25 23:46
→ fdvd:說 只需要數值的部份而不涵蓋單位, 可以考慮在substring完後 06/25 23:47
→ fdvd:將單位的字串trim掉 只是不確定原PO是不是指這意思@@" 06/25 23:47
→ aacced:string strSample = "Width:100cm"; 06/26 01:02
→ aacced:int iCapture = strSample.IndexOf(":") + 1; 06/26 01:03
→ aacced:string strResult = strSample.Substring(iCapture, (strSa 06/26 01:04
→ aacced:mple.Length - iCapture - 2)); 06/26 01:04
→ aacced:最後-2是減掉cm, 也可以先判斷字串內有無cm,若無就不-2 06/26 01:09
→ chrisQQ::後面值的部份直接正規砍掉不是 0-9\. 的會不會比較簡單 06/26 11:33
→ chrisQQ:原來原PO不要 regex 我錯了... 06/26 11:33