Logo

Programming-Idioms

History of Idiom 96 > diff from v34 to v35

Edit summary for version 35 by mattdaly:
New Csharp implementation by user [mattdaly]

Version 34

2017-11-30, 21:20:01

Version 35

2019-01-06, 03:36:07

Idiom #96 Check string prefix

Set boolean b to true if string s starts with prefix prefix, false otherwise.

Illustration

Idiom #96 Check string prefix

Set boolean b to true if string s starts with prefix prefix, false otherwise.

Illustration
Code
bool b = s.StartsWith(prefix);
Doc URL
https://docs.microsoft.com/en-us/dotnet/api/system.string.startswith?view=netframework-4.7.2