Split(string, string)
The Split(string, string) function splits a string on a specified separator character and returns a string collection.
Syntax
Copy Code | |
---|---|
collection<string> Split( string source, string separator ); |
Parameters
Return Values
Returns a collection of string values. Use the foreach keyword to iterate through the collection. If the separator string is not found, this function returns the original source string value as the single element in the collection.
Example Code
The following code example splits a URI on the "@" (at) symbol, returning the username as the first element in the collection and the hostname as the second.
Copy Code | |
---|---|
foreach (userAndHost in Split(GetUri(sipRequest.From), "@"))) { ... } |