dcsimg
A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: replacing char from a string

  1. #1
    Senior Member
    Join Date
    Jan 2001
    Posts
    166

    replacing char from a string

    I have a string like "I'm 4 years old"

    How can I make loop that replaces fx the '4' with fx '5'?


    Regards

    Godowsky

  2. #2
    _level0
    Join Date
    Jul 2002
    Posts
    55
    Look at it and tell me if you want the same

    Regards

    Dabz
    Attached Files Attached Files

  3. #3
    Senior Member
    Join Date
    Jan 2001
    Posts
    166
    except for the commas everything looks nice..


    Regards

    Godowsky

  4. #4
    Senior Member
    Join Date
    Aug 2002
    Location
    Dublin, Ireland
    Posts
    1,749

    Another take on the same thing

    As an alternative:

    sent = "I am 4 years old.";
    sentfor = sent.split("4").join("5");
    trace( sentfor );

    Gives the output: "I am 5 years old."

  5. #5
    Senior Member
    Join Date
    Jan 2001
    Posts
    166
    thanx a lot :-)

    Godowsky

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center