E. 212 Number series Mobile Country Code (MCC) Mobile Network Code (MNC)
530 01
Output:
530
01
thanks
shaik
E. 212 Number series Mobile Country Code (MCC) Mobile Network Code (MNC)
530 01
Output:
530
01
thanks
shaik
You can try this way, variable type is string
System.Text.RegularExpressions.Regex.Match("Inputstring","(\d+)\s(\d+)").Groups(1).Value
Output = 530
System.Text.RegularExpressions.Regex.Match("Inputstring","(\d+)\s(\d+)").Groups(2).Value
Output = 01
Regards,
Gowtham Krishnan
Can you try the below
Match = System.Text.RegularExpressions.Regex.Match(Input,"(\d+\s+\d+)").Value
Output1 = Match.Split(" "c)(0)
Output2 = Match.Split(" "c)(1)
Regards,
I’ll give you yet another option using named groups:
Regex.Match("530 01", "(?<MCC>\d{3})\s(?<MNC>\d{2})", RegexOptions.ExplicitCapture)
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.