This language bar is your friend. Select your favorite languages!

Idiom #96 Check string prefix

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

Illustration
#Edit dateEdit SummaryEditor
👁 Δ 34 2017-11-30, 21:20 Linked to idiom #167 [Trim prefix] programming-idioms.org
👁 Δ 33 2017-07-21, 13:33 [Erlang] string:str/2 is obsolete tamarit
👁 Δ 32 2017-05-27, 19:49 New C implementation by user [Dodopod] Dodopod
👁 Δ 31 2017-04-29, 07:18 [Rust] Fixed demo link TheVTM
👁 Δ 30 2017-04-27, 08:53 New Rust implementation by user [TheVTM] TheVTM
👁 Δ 29 2017-03-06, 21:22 New Elixir implementation by user [programming-idioms.org] programming-idioms.org
👁 Δ 28 2016-12-10, 17:37 [Erlang] Fixed demo : looking for prefix, not any occurrence programming-idioms.org
👁 Δ 27 2016-12-10, 07:39 [Erlang] begin with Prefix IUnknown
👁 Δ 26 2016-11-05, 03:49 New Lua implementation by user [Nepta] Nepta
👁 Δ 25 2016-09-27, 11:27 Updated picture URL by user [programming-idioms.org] programming-idioms.org
👁 Δ 24 2016-05-03, 20:56 New JS implementation by user [programming-idioms.org] programming-idioms.org
👁 Δ 23 2016-05-03, 20:51 New JS implementation by user [programming-idioms.org] programming-idioms.org
👁 Δ 22 2016-04-06, 19:32 New Ruby implementation by user [steenslag]
👁 Δ 21 2016-02-23, 21:03 [PHP] Comments: where is prefix
👁 Δ 20 2016-02-23, 13:37 [PHP] better syntax
👁 Δ 19 2016-02-23, 13:32 New PHP implementation by user [Feifan]
👁 Δ 18 2016-02-18, 16:58 New Haskell implementation by user [JH]
👁 Δ 17 2016-02-16, 19:36 New Haskell implementation by user [JH]
👁 Δ 16 2016-01-21, 09:16 [Pascal] Comment emphasize
👁 Δ 15 2016-01-15, 15:36 New Pascal implementation by user [Bart]
👁 Δ 14 2016-01-02, 01:16 New Java implementation by user [lck]
👁 Δ 13 2015-11-30, 12:37
👁 Δ 12 2015-11-03, 23:47
👁 Δ 11 2015-11-03, 23:46 New D implementation by user [piou]
👁 Δ 10 2015-10-31, 15:35
👁 Δ 9 2015-10-29, 14:05
👁 Δ 8 2015-10-28, 01:49
👁 Δ 7 2015-10-25, 18:56
👁 Δ 6 2015-10-18, 16:05
👁 Δ 5 2015-10-18, 16:01
👁 Δ 4 2015-10-18, 13:22
👁 Δ 3 2015-10-08, 12:53
👁 Δ 2 2015-10-08, 12:53
1 2015-10-08, 12:50