expression r c3 a9guli c3 a8re t c3 a9l c3 a9phone java

Solutions on MaxInterview for expression r c3 a9guli c3 a8re t c3 a9l c3 a9phone java by the best coders in the world

showing results for - "expression r c3 a9guli c3 a8re t c3 a9l c3 a9phone java"
James
16 Jul 2019
1// verifie le format d'un String de numero de telephone et ajuste le format
2// Format possible : xxxxxxxxxx || xxx xxxxxxx || xxxxxx xxxx || xxx xxx xxxx
3// xxx-xxxxxxx || xxxxxx-xxxx || xxx-xxx xxxx || xxx xxx-xxxx || xxx-xxx-xxxx
4// (xxxxxxxxxx || xxx)xxxxxxx || (xxx xxxxxxx || xxx) xxxxxxx || (xxx-xxxxxxx
5// etc.
6// Format final : (xxx)xxx-xxxx
7if(numero.matches("\(?(\d{3})\)?[- ]?(\d{3})[- ]?(\d{4})")){
8	newNumero = numero.replaceFirst("\\(?(\\d{3})\\)?[- ]?(\\d{3})[- ]?(\\d{4})", "($1)$2-$3");
9}