« NormalizePhoneNumber (rtl) » : différence entre les versions
(Page créée avec « <source lang="delphi">Function NormalizePhoneNumber(const iNumber,iCountryCodeISO:string; iHuman:boolean):string;</source> Cette fonction normalise un numéro de téléph... ») |
Aucun résumé des modifications |
||
Ligne 1 : | Ligne 1 : | ||
{{latest}} | |||
<source lang="delphi">Function NormalizePhoneNumber(const iNumber,iCountryCodeISO:string; iHuman:boolean):string;</source> | <source lang="delphi">Function NormalizePhoneNumber(const iNumber,iCountryCodeISO:string; iHuman:boolean):string;</source> | ||
Ligne 46 : | Ligne 47 : | ||
[[category:RTL Chaîne]] | [[category:RTL Chaîne]] | ||
[[Category:Mobiles]] | [[Category:Mobiles]] | ||
[[Category:Latest]] |
Version du 15 janvier 2014 à 13:24
{{#images:versionlatest-32x32.png|stock}} <source lang="delphi">Function NormalizePhoneNumber(const iNumber,iCountryCodeISO:string; iHuman:boolean):string;</source>
Cette fonction normalise un numéro de téléphone suivant le format international.
Result | Le numéro de téléphone normalisé |
iNumber | Le numéro à normaliser |
iCountryCodeISO | Le code ISO du pays (3 ou 2) |
iHuman | Formate le numéro pour être affiché. |
Exemple
<source lang="delphi">
procedure foo(); begin
.... if Assigned(contact) and (contact.phone<>) then begin json.result[indx].t := 'phone'; json.result[indx].v := Format('%s phone :%s',[contact.firstName,NormalizePhoneNumber(contact.phone,inst.countryISO,true)]); json.result[indx].l := 'l'; json.result[indx].h := 'tel:'+NormalizePhoneNumber(contact.phone,inst.countryISO,false); indx := indx+1; end; ...
end; </source>
Voir aussi:
{{#if:Développement DSM|
{{#if:Développement DSM|— Développement DSM |}} — Développement DSM —
|
{{#if:|— [[{{{1}}}]] |}} — Développement DSM —
}}