Logo

Programming-Idioms

History of Idiom 96 > diff from v11 to v12

Edit summary for version 12 by :

Version 11

2015-11-03, 23:46:48

Version 12

2015-11-03, 23:47:19

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;
Imports
import std.algorithm.searching;
Code
bool b = s.startsWith(prefix);
Code
b = s.startsWith(prefix);
Doc URL
http://dlang.org/phobos/std_algorithm_searching.html#.startsWith
Doc URL
http://dlang.org/phobos/std_algorithm_searching.html#.startsWith