Split(string, bool, string)
The Split(string, bool, string) function splits a string on a specified separator character or set of characters and returns a string collection. This function is an overload of Split(string, string).
Syntax
Copy Code | |
---|---|
collection<string> Split( string source, bool charsNotInSet, string charSet ); |
Parameters
Return Values
Returns a collection of string values. Use the foreach keyword to iterate through the collection. If no member of charSet is found, this function returns the original string value as the single element in the collection.
Remarks
Adjacent characters belonging to CharSet are treated as a single separator.
Example Code
Assuming a set of SIP URIs that include the optional port and param values, the following code example splits the URIs on the ":" (colon) and ";" semicolon symbols, returning the URI scheme as the first element, the SIP address as the second element, the port number as the third element, and the URI parameter as the fourth element in the collection.
Copy Code | |
---|---|
foreach (fullSIPuri in Split(GetUri(sipRequest.From), "false", ";:") {...} |