User Tag List

Results 1 to 6 of 6

Thread: String Parser, Wildcard

  1. #1
    Clickteam Clickteam
    Olivier's Avatar
    Join Date
    Jun 2006
    Posts
    3,000
    Mentioned
    9 Post(s)
    Tagged
    1 Thread(s)

    String Parser, Wildcard

    In a given string I'd like to replace several characters by another one. Is it possible with String Parser to do that in a single event in replacement of the 3 events below?
    Code:
    String Parser Set source string to replace$( "String Parser", "a", "$")
    String Parser Set source string to replace$( "String Parser", "b", "$")
    String Parser Set source string to replace$( "String Parser", "c", "$")
    With the wildcard option enabled I've tried to use the code below without success. I think I'm missing something, or maybe the multi-character matching operator * doesn't work this way.
    Code:
    String Parser Set source string to replace$( "String Parser", "a*b*c*", "$")

  2. #2
    Forum Moderator Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Jun 2006
    Location
    England
    Posts
    3,546
    Mentioned
    4 Post(s)
    Tagged
    1 Thread(s)

    Re: String Parser, Wildcard

    String Parser supports wildcards but not regular expressions.

    You could:
    1. Set source string to set$( "String Parser", replace$( "String Parser", "a","$"))+set$( "String Parser", replace$( "String Parser", "b","$"))+set$( "String Parser", replace$( "String Parser", "c","$"))+string$( "String Parser" )
    2. Use the SubString Replace Object: ReplaceSubstring$( "Substring Replace", ReplaceSubstring$( "Substring Replace", ReplaceSubstring$( "Substring Replace", "aabbcc", "a", "$"), "b", "$"), "c", "$")
    3. Use loops
    4. Use the Regular Expression Object
    .:::.Joshtek.:::.

  3. #3
    Clickteam Clickteam
    Olivier's Avatar
    Join Date
    Jun 2006
    Posts
    3,000
    Mentioned
    9 Post(s)
    Tagged
    1 Thread(s)

    Re: String Parser, Wildcard

    Wow thank you very much Joshtek for such an exhaustive answer.

  4. #4
    Forum Moderator Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Jun 2006
    Location
    England
    Posts
    3,546
    Mentioned
    4 Post(s)
    Tagged
    1 Thread(s)

    Re: String Parser, Wildcard

    If you want to see how to do the loop method then check out part 4 of the MooClick video tutorials (linky).
    .:::.Joshtek.:::.

  5. #5
    Clickteam Clickteam
    Olivier's Avatar
    Join Date
    Jun 2006
    Posts
    3,000
    Mentioned
    9 Post(s)
    Tagged
    1 Thread(s)

    Re: String Parser, Wildcard

    A bit off topic but it's worth mentioning anyway. For people interested in converting upper/lower characters with accents, Sphax has just updated his Formatted object to allow for this. The extension is available via FusionUpdater:
    http://complex.ovh.org/index.php?p=products&l=en

  6. #6
    Clickteam Clickteam
    Olivier's Avatar
    Join Date
    Jun 2006
    Posts
    3,000
    Mentioned
    9 Post(s)
    Tagged
    1 Thread(s)

    Re: String Parser, Wildcard

    Another similar problem. I couldn't find a way to replace [whatever_string_inside_brackets] by another string. Let's say I have the string below:
    Code:
    Hit [whatever] to jump.
    How to transform it in:
    Code:
    Hit [spacebar] to jump.
    I've tried the (pseudo) code below without success. Yet the wildcard option is checked. Any clue?
    Code:
    •Start of Frame
       String Parser: Set source string to "Hit [whatever] to jump."
       String: Set alterable string to replace$( "String Parser", "[*]", "[spacebar]")

Similar Threads

  1. String splitting with string parser
    By Sejez in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 5th February 2013, 05:31 AM
  2. Using String Parser to check for any punctuation in a string
    By Apex in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 18th May 2012, 11:03 PM
  3. Help with string parser please?
    By pinacoladaxb in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 27th September 2009, 03:10 AM
  4. String Parser or String Parser 2? Vitalized
    By DJ_Wild in forum Multimedia Fusion 2 - Technical Support
    Replies: 10
    Last Post: 5th September 2009, 10:12 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
  •