參考程式碼:
Function
M2P11(ByVal s As String) As String
Dim num
= ""
For i =
1 To s.Length
Dim c As Char = Mid(s, i, 1)
If
(c >= "0" And c <= "9") Then num &= c
Next
If
num.Length = 0 Then Return "N"
Return
num
End
Function
----------------------
in1.txt
----------------------
2
09ab2cckd7
ab21cdgcbgq123
----------------------
in2.txt
----------------------
3
129vbvs213zxcv7
Nb22429hhh
NB
----------------------
out.txt
----------------------
0927
21123
1292137
22429
N
0 意見:
張貼留言