User Tag List

Results 1 to 3 of 3

Thread: search for string in string

  1. #1
    Clicker Fusion 2.5Android Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)
    Vetmora's Avatar
    Join Date
    Jul 2010
    Location
    Australia
    Posts
    142
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    search for string in string

    Hey all,

    Just wondering what is the best way, or if there is a way, to search or compare two strings for a match. For example:

    If you search and compare both of the following strings, the result would be "flower", as both contain that word.
    String 1. "mountainflower"
    String 2. "redflower"

    The closest way I've found to do this is Find(String1, Right$(String2, 3 ), 0 ). However it's not ideal as you need to specify the length of the string. I'd like it if it could just search the whole string as they're going to change.

    Is this possible at all? Any help much appreciated.

    Thanks in advance
    Vet

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Popcorn's Avatar
    Join Date
    Jun 2006
    Location
    Norway, Bergen
    Posts
    2,367
    Mentioned
    13 Post(s)
    Tagged
    0 Thread(s)
    I thought this should be easy, but it took me quite some time to get a working example.
    The easy answer is to say you need to use fastloos. But it gets a bit complicated as you need take into account all possible words inside the two strings.
    This example should work for any two strings, and I set it up to only find strings that are 3 letters or longer. You can change this yourself.
    Attached files Attached files

  3. #3
    Clicker Fusion 2.5Android Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)
    Vetmora's Avatar
    Join Date
    Jul 2010
    Location
    Australia
    Posts
    142
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi guys,

    Thanks for the help. I really appreciate it! I ended up using Snail's example, purely for the fact it uses less objects as this is a minor game mechanic.

    They are both great examples to get the same result. It certainly would have taken me a while to replicate.

    Thanks again

Similar Threads

  1. search all for string
    By wuxuechen in forum Fusion 2.5
    Replies: 6
    Last Post: 3rd August 2014, 02:44 AM
  2. Search string in string
    By Sevennemesis in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 10th December 2012, 04:12 AM
  3. Search for string
    By Pkeod in forum File Archive
    Replies: 0
    Last Post: 17th April 2009, 05:31 AM
  4. Search a string for a word. Help!!!!!
    By Tim in forum Multimedia Fusion 2 - Technical Support
    Replies: 9
    Last Post: 21st August 2008, 01:19 AM

Posting Permissions

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