Logo

Programming-Idioms

History of Idiom 39 > diff from v22 to v23

Edit summary for version 23 by :
New Ada implementation by user [Smaehtin]

Version 22

2016-02-17, 11:23:12

Version 23

2016-02-18, 08:50:40

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;