See the example below how StartsWith() and EndsWith() funtions.
For example (StartsWith()):
bool result = strOne.StartsWith("R",StringComparison.CurrentCultureIgnoreCase);
MessageBox.Show(result.ToString());
Output:
True (Because string starts with ‘r’ ignoring case)
For example (EndsWith()):
string strOne = "rocks Rum"
bool result = strOne.EndsWith("m", StringComparison.CurrentCultureIgnoreCase);
MessageBox.Show(result.ToString());
Output:
True (Because string ends with ‘m’ ignoring case)
0 comments:
Post a Comment