Results 1 to 6 of 6

Thread: Stripping a string

  1. #1
    Join Date
    Dec 2011
    Location
    Toronto, Ontario
    Posts
    6,424
    Mentioned
    84 Post(s)
    Quoted
    863 Post(s)

    Default Stripping a string

    Hey guys, say my string contains 'partyhats'.
    What would i do to check if the string contains the word 'partyhat'?
    I know about Pos(); but I dont know how to use it.

  2. #2
    Join Date
    Sep 2012
    Location
    Here.
    Posts
    2,007
    Mentioned
    88 Post(s)
    Quoted
    1014 Post(s)

  3. #3
    Join Date
    Dec 2011
    Location
    New York, USA
    Posts
    1,242
    Mentioned
    12 Post(s)
    Quoted
    193 Post(s)

    Default

    Simba Code:
    if pos() > 0 then
      StringContainsPartyhat := true;

  4. #4
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    I only know how to do this in java and I'm basicly retarded in java.. its something like
    javajava Code:
    ContaintsTextIgnoreCase('jdgjdfpartyhatfjksj')
    Idk you can try something like that

  5. #5
    Join Date
    Dec 2011
    Location
    Toronto, Ontario
    Posts
    6,424
    Mentioned
    84 Post(s)
    Quoted
    863 Post(s)

    Default

    Quote Originally Posted by nivek1989 View Post
    Simba Code:
    if(pos('partyhat', 'partyhats') <> 0)then
    Thanks +rep

    /thread.

  6. #6
    Join Date
    Jul 2011
    Location
    /home/litoris
    Posts
    2,226
    Mentioned
    0 Post(s)
    Quoted
    159 Post(s)

    Default

    You should also check out regex, it has many advanced text related functions.
    Miner & Urn Crafter & 07 Chicken Killer
    SPS BlindWalk Tutorial

    Working on: Nothing

    teacher in every art, brought the fire that hath proved to mortals a means to mighty ends

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •