SiMX Help‎ > ‎The Target Platform‎ > ‎Objects‎ > ‎TARGET Object‎ > ‎target.strlib‎ > ‎

GetPhone


Platform Objects


Description

Extracts a telephone number from the input.  Designed to handle US numbers, international numbers with country prefixes, and extension numbers.

Syntax


Function  GetPhone( input, format, pos )

                    input - String to be parsed
format Boolean - Would you like your phone number formatted?  (default is true)
pos integer (optional, in/out) - search from position (default is 0)

Return value


This function returns a string.

Sample

'---------- Start ----------
Function Start
Dim str, str2

str = "If you need to extract numbers such as 123-456-7890 use target object GetPhone"
str2 = target.strlib.GetPhone( str )
trg.Message( str2 )

End Function

          In this case the input string is parsed for a phone number which is then extracted.


See also


Platform Objects and Methods
Trim
Split
Mid