Navigation

    Fuze Arena Logo
    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    • Help
    • Discord

    strContains() example code

    Help
    3
    4
    188
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • F
      fistfullofnails last edited by

      So I was trying to figure out how to use the strContains() function and never could get it to work for me. I ended up copying and pasting the example code and it would not work as well. I noticed in that example code that strContains() seemed to have gotten switched with the strBeginsWith? function, but it looked as if I just substituted the strContains() in it’s place, that it should have worked.

      1 Reply Last reply Reply Quote 0
      • pianofire
        pianofire Fuze Team last edited by pianofire

        Yes you are correct but the "then" is missing as well! I think that the example should have been:

        stringVar = "FUZE"
        to_find = "Z"
        
        loop
            clear()
            if strContains( stringVar, to_find ) then
                print( "String '", stringVar, "' contains '", to_find, "'" )
            else
                print( "String '", stringVar, "' does not contain '", to_find, "'" )
            endif
            update()
        repeat
        
        P 1 Reply Last reply Reply Quote 1
        • P
          petermeisenstein F @pianofire last edited by

          @pianofire why is ther the double and single paranthese in your example isnt the double paranthe enough ?

          pianofire 1 Reply Last reply Reply Quote 0
          • pianofire
            pianofire Fuze Team @petermeisenstein last edited by

            @petermeisenstein It is just for the output format it prints:

            String 'FUZE' contains 'Z'
            
            1 Reply Last reply Reply Quote 0
            • First post
              Last post