Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic


The StartsWithString function indicates whether a specified source string begins with a specified search string.


bool StartsWithString(
  string sourceString,
  string searchString,
  bool ignoreCase



Specifies the source string that the function examines.


Specifies the string to search for at the beginning of the string specified by sourceString.


Specifies whether the search is case-sensitive or case-insensitive. If false, the search is case-sensitive. If true, the search is case-insensitive.

Return Values

Returns true if the string specified by sourceString begins with the string specified by searchString. Returns false if either the sourceString does not begin with searchString, or if searchString is longer than sourceString.

Example Code

The following code example assumes that headerString contains a SIP URI that includes a parameter named "user". The example code determines whether the value of the user parameter begins with "phone", and is case-insensitive.

StartsWithString(GetParameterValue(headerString, "user"), "phone", "true")
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
© 2014 Microsoft. All rights reserved.