Logo

Programming-Idioms

History of Idiom 96 > diff from v26 to v27

Edit summary for version 27 by IUnknown:
[Erlang] begin with Prefix

Version 26

2016-11-05, 03:49:51

Version 27

2016-12-10, 07:39:00

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) =/= 0.
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=2df3