Logo

Programming-Idioms

History of Idiom 39 > diff from v23 to v24

Edit summary for version 24 by :
New Csharp implementation by user [javasucks]

Version 23

2016-02-18, 08:50:40

Version 24

2016-02-18, 16:57:59

Idiom #39 Check if string contains a word

Set boolean ok to true if string word is contained in string s as a substring, or to false otherwise.

Idiom #39 Check if string contains a word

Set boolean ok to true if string word is contained in string s as a substring, or to false otherwise.

Imports
with Ada.Strings.Fixed;
use Ada.Strings.Fixed;
Code
Ok : Boolean := Index (S, Word) > 0;