Searching Text is it possible.

TWEAmazingAppsTWEAmazingApps Member Posts: 219
edited April 2012 in Working with GS (Mac)
Is there any search functions you can use that on a text attribute. I just want select a potion of text in a text attribute.

thank you.

Best Answers

  • simo103simo103 Posts: 1,331
    Accepted Answer
    not sure if you edited your question after tenrdrmer posted but anyway will try to help. You have the ability to use a rule to see if a text attribute 'contains' a word. So for example if the text attribute had this text in it: "The dog chased the cat" you could check to see if it contained 'cat' and it would come back true. tshirtbooth provided a way to search for specific words by putting the words in the text attribute with '!' on both sides like '!cat!', '!dog!' etc ... this way if you added the '!' to your search word it would find the exact match rather than indicating true when searching for cat but the text attribute had 'The caterpillar moved slowly' for example.
  • tatiangtatiang Posts: 11,949
    Accepted Answer

Answers

  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    Why do you want to limit what people can put in their game that only they will see?

    Im sure you could build a work check like TSB's dictionary thing and make rule to change the letters anytime the names matched but again why are you putting restrictions on your users when anything they enter can only be viewed on their device?
  • TWEAmazingAppsTWEAmazingApps Member Posts: 219
    @simo103 thanks simo, do you know which tutorial tshirtbooth taught that, or where can I find out how to implement that? Thanks!
  • TWEAmazingAppsTWEAmazingApps Member Posts: 219
    @tatiang thanks so much!
  • TWEAmazingAppsTWEAmazingApps Member Posts: 219
    @tatiang, @simo103 I checked out that tshirtbooth project and i noticed that he didn't search for a word that is within a sentence, it was just single words (search for a single word, but the keyboard input was also a single word and not a sentence or paragraph of words). The problem is if i do a "attribute contains (a certain word)" rule it would show up false if another word has those same letters in their own word. for example, if i search through a keyboard input for the word "cat" it would show up true even when it finds the word "catepillar" because of the c.a.t. in that word. Is there any workaround to this? Thanks!
  • simo103simo103 Member, PRO Posts: 1,331
    edited April 2012
    @TWEAmazingApps ... yes you have found the problem .. at the moment GS doesn't allow string manipulation. The only way I could see doing this is to make your own keyboard and capture each key clicked and when clicking the space bar put a '!!' in. This way if this was entered you would have:"!!The!!caterpillar!!moved!!slowly!!". Thus a search for !cat! would fail but !moved! would be positive.
  • TWEAmazingAppsTWEAmazingApps Member Posts: 219
    @simo103 thanks for the quick reply
Sign In or Register to comment.