Skip to main content
Known Participant
Aug 29, 2023 8:02 AM UTC
Question

How can we compare two text values

Hi All,

How can we compare two text values

for example "batting" is text1 and "bat" is text2

if batting compare with bat then it should write True. because bat word is there in batting word

Is there any logic for this ?

    3 replies

    Inspiring
    Aug 29, 2023 9:08 AM UTC
    anmolv0003
    Participating Frequently
    Aug 29, 2023 9:38 AM UTC

    Logic for find() function as suggested by Purvaja

    a!localVariables(
      local!x: find("bat", "batting"),
      if(local!x <> 0, true, false()),
    )

    You can also use search() or searchb() funtions for the same in place of find() function.

    Anmol
    mathieud0001
    Genius
    Aug 29, 2023 11:12 AM UTC

    One thing to note is that find() is case sensitive while search() is case insensitive depending on what your use case may be.