Skip to main content
New Participant
Nov 18, 2025 6:06 AM UTC
Question

search text key word from a sentence

i have a sentence that "Benefit Period: To Age 75; Indexation: CPI Linked" in this I need to validate that whether "Indexation: CPI Linked" is found or not 

please give me a suggestion

5 replies

shubhama926776
Brainy
Nov 18, 2025 6:24 AM UTC

Make a use of a!isInText( text, subtext )

a!isInText("Benefit Period: To Age 75; Indexation: CPI Linked", "Indexation: CPI Linked")

शुभम्
davidj137213
Brainy
Nov 18, 2025 9:53 AM UTC

Do it this way… it works the way you need.

stefanhelzle0001
Brainy
Nov 18, 2025 6:52 AM UTC
mikes0011
Brainy
Nov 18, 2025 1:53 PM UTC

I second Shubham's suggestion of a!isInText() being newer and more likely to be flexible.  I will just point out that the classic way of doing this would have been "search()", which is case insensitive, and "find()", which is case sensitive.  Either or both could be used for your particular use case - these both return not "true" or "false", but rather an index number of the position that the target text is found within the source text (or 0 if not found at all).

The Expression Guru
Participating Frequently
Nov 20, 2025 6:09 AM UTC

Hi [mention:9684f2a1b2d2427fbc85a4776fe2be35:e9ed411860ed4f2ba0265705b8793d05] 

You can use find() or search() function to check if a word is there or not in your text and then add a condition to get the boolean value. find or search function gives you the index of the word you are searching in the text string. so if you get 0 as a result then it means the word you searched is not available hence you can get output as false and if it gives any non zero integer , it means you found the word in your text string. See below example.

a!localVariables(
  local!position: find(
    "Indexation: CPI Linked",
    "Benefit Period: To Age 75; Indexation: CPI Linked"
  ),
  if(local!position = 0, false, true)
)