Logo

Programming-Idioms

History of Idiom 96 > diff from v27 to v28

Edit summary for version 28 by programming-idioms.org:
[Erlang] Fixed demo : looking for prefix, not any occurrence

Version 27

2016-12-10, 07:39:00

Version 28

2016-12-10, 17:37:41

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
B = string:str(S, Prefix) =:= 1.
Code
B = string:str(S, Prefix) =:= 1.
Doc URL
http://erldocs.com/current/stdlib/string.html?i=0&search=string:st#str/2
Doc URL
http://erldocs.com/current/stdlib/string.html?i=0&search=string:st#str/2
Demo URL
http://tryerl.seriyps.ru/#id=2df3
Demo URL
http://tryerl.seriyps.ru/#id=49f3