Logo

Programming-Idioms

History of Idiom 96 > diff from v13 to v14

Edit summary for version 14 by :
New Java implementation by user [lck]

Version 13

2015-11-30, 12:37:31

Version 14

2016-01-02, 01:16:29

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.

Code
boolean b = s.startsWith(prefix);
Doc URL
https://docs.oracle.com/javase/7/docs/api/java/lang/String.html#startsWith%28java.lang.String%29