i have “Service Address”:“16649N34THPL,Noida,AZ85032-2776” and want to fetch 16649N34THPL and put space after 5 digit and got 1 alphabet and then put one more space, find last two digit and put space before them like 16649 N 34TH PL. everything fix except the position 34TH can be 4 digit or 5 or 6 but space should be before last two digit
Is that a json string?
If yes then you can get the value by using deserialize and then requiredstring = jobj("Service Address").ToString.Split(","c).First.Trim will give the number part
Now for the spaces try this in assign
Finalstring = System.Text.RegularExpressions.Regex.Replace(requiredstring,"(?<=^\d{5})|(?<=^\d{5}.)|(?=.{2}$)"," ")
Cheers
Use below syntax in Assign:
Assign activity -> serviceAddress = jObject("Service Address").ToString
Assign activity -> formattedAddress = serviceAddress.Split(","c)(0).Substring(0, 5) & " " & serviceAddress.Split(","c)(0).Substring(5).Insert(1, " ").Insert(serviceAddress.Split(","c)(0).Substring(5).Insert(1, " ").Length - 2, " ")
Regards
Hey @jitendra.saroj
Check out the Screenshot
Use the Regex Given Below :
String.Join(" “, System.Text.RegularExpressions.Regex.Matches(input_String,” (\d+)([A-Z]+)(\d+)([A-Z]{2})([A-Z]{2})“).Select(Function(m) m.Groups(1).Value & " " & m.Groups(2).Value & " " & m.Groups(3).Value & " " & m.Groups(4).Value &” "& m.Groups(5).Value))
Cheers ![]()
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.


