Check whether the Phone Number is valid for SMS usage and return the constituent parts.

There are 2 acceptable format options for SMS phone numbers: a. The base mobile number, optionally including spaces, dashes and brackets, which will have its zero prefix removed and the default Country code added e.g. "0251111111", "025 1111111", "025-1111111" or "(025)1111111" -> "+64251111111" b. The Country code, with a space, dash or bracket after it, and then the base mobile number e.g. "+64 251111111", "+64 025 1111111", "+64-25-1111111" or "+64(25)1111111" -> "+64251111111" Validation Rules: a. The full formatted SMS telephone number, excluding the plus symbol, can have a maximum of 15 digits. b. The Country code, excluding the plus symbol, can have a maximum of 3 digits. c. The Base Phone Number must have a minimum of 5 digits. d. The Base Phone Number cannot have more than one leading zero. e. Base Phone Numbers with one leading zero will drop the leading zero.

Syntax

ISPhoneNumberDetails.GetPhoneNumberForSms(smsPhoneNumber, [extractedInternationalCode], [extractedPhoneNumber], [invalidMessage])

Parameters

NameTypeOptionalByRefDescription
smsPhoneNumber String ByRef The fully formatted telephone number for SMS usage, this includes the Country code and is prefixed with the plus symbol e.g. "+64251111111"
extractedInternationalCode String Optional ByRef The Country Code including the plus symbol that has been extracted from the phone number, or, alternatively, added to the phone number if necessary e.g. "+64"
extractedPhoneNumber String Optional ByRef The Phone Number without the Country code, leading zero, spaces or special characters e.g. "251111111"
invalidMessage String Optional ByRef A Message indicating why this is not a valid SMS Phone Number.

Return Value

Boolean
Member of:
ISPhoneNumberDetails
Namespace:
Intersoft.ISRuntime6
Assembly:
ISRuntime6, Version=6.0.3
Target Framework:
.NET 9.0