Logo

Programming-Idioms

History of Idiom 96 > diff from v10 to v11

Edit summary for version 11 by :
New D implementation by user [piou]

Version 10

2015-10-31, 15:35:50

Version 11

2015-11-03, 23:46:48

Idiom #96 Check string prefix

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

Idiom #96 Check string prefix

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

Imports
import std.algorithm.searching;
Code
bool b = s.startsWith(prefix);
Doc URL
http://dlang.org/phobos/std_algorithm_searching.html#.startsWith