Have an input which could be 8 digits
12345678
What is the suitable command to use in order to add in a space after the first two numbers and then a space for every three numbers after that then.
Input: 12345678
Output: 12 345 678
Any suggestions would be appreciated please.
Thanks
Hi @ciaramkm,
Please find the solution.
input=“12345678”
output=input.Substring(0,2)+" “+input.Substring(2,3)+” "+input.Substring(4,4).Remove(0,1)
Regards,
Omkar P
1 Like
2 Likes
Thanks for your help
1 Like
Please avoid pure string manipulations for this. You can broaden this to humanization and rely on integrated tools designed for this purpose. Here, I use french output (that fit your expected output) but you can set your target culture.
CInt(Input).ToString("#,##0", New System.Globalization.CultureInfo("fr-FR"))
1 Like
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.