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 foreachkeyword to iterate through the collection. If no member of charSetis found, this function returns the original string value as the single element in the collection.
Remarks
Adjacent characters belonging to CharSetare treated as a single separator.
Example code
Assuming a set of SIP URIs that include the optional portand paramvalues, 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", ";:") {...} |