-1

Our customers often fill out "incorrect" formatted phone-numbers. Do anyone know if there is any lib or standard to convert numbers into a more international style?

This is a Swedish example but we have customers around the globe and i don't what to manually handle implementations for everyone.

input often is like this: 0555 11122

and the wanted result is something like this: +46(0)555-11122

I can do the formatting myself but different countries have different variations and systems so a C/Java/C# lib or a standard method to handle this would be great.

Cœur
  • 37,241
  • 25
  • 195
  • 267
Sven
  • 1,935
  • 2
  • 13
  • 7

1 Answers1

0

Sound like a job for Regular Expressions.

You can do regex conversions in almost any language. If you are doing this in C#, you would use Regex.Replace() with the proper regex expression for international numbers.

See: What regular expression will match valid international phone numbers?

Community
  • 1
  • 1
Ed B
  • 6,028
  • 3
  • 26
  • 35