A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Please Help, replacing \/?

  1. #1
    Junior Member
    Join Date
    Nov 2008
    Posts
    18

    Please Help, replacing \/?

    Im making a program that gets a hold of a string that uses this:

    \/\/

    I simply want all \ removed from the string, can anyone give me a surefire way thats simple and not big?

    I need this to work:

    trace(tempSplit2[0].replace("\", ""));

  2. #2
    half as fun, double the price senocular's Avatar
    Join Date
    Feb 2002
    Location
    San Francisco, CA (USA)
    Posts
    4,361
    .replace(/\\/g, "")

  3. #3
    Senior Member
    Join Date
    Jul 2009
    Posts
    113
    Try this...

    Code:
    var stringToProcess = "\/\/abc\/\/def\/\/ghi\/\/";
    
    trace(stringToProcess.replace("\\", ""));
    
    // Prints //abc//def//ghi//

  4. #4
    Senior Member joshstrike's Avatar
    Join Date
    Jan 2001
    Location
    Alhama de Granada, España
    Posts
    1,136
    I love how Senocular speaks regexp as a second language...

  5. #5
    half as fun, double the price senocular's Avatar
    Join Date
    Feb 2002
    Location
    San Francisco, CA (USA)
    Posts
    4,361
    I may be able to speak it, but when others talk to me in it, I can't understand a word they're saying

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