Logo

Programming-Idioms

History of Idiom 39 > diff from v24 to v25

Edit summary for version 25 by :
Restored version 23

Version 24

2016-02-18, 16:57:59

Version 25

2016-02-18, 17:22:54

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;