search text key word from a sentence

Certified Associate Developer

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

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    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).

Reply
  • 0
    Certified Lead Developer

    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).

Children
No Data