Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2003
    Posts
    1

    Unanswered: Using split with reserved special characters

    I am trying to use the split function to replace a string in the format mm/dd/yyyy, but, when i use the following code,

    @Stringout = split /\\//,$Stringinp;

    The output is ddyyyy and i lose mm...

    what am i doing wrong? i was looking through documentation and all it says is that i need to use a "\" when using special chars.

    Thanks.

  2. #2
    Join Date
    Nov 2003
    Posts
    65

    Wink

    The following code works for me. You might have had one to many escape characters on ur split statement.
    Code:
    $Stringinp = "09/12/2004";
    @Stringout = split /\//, $Stringinp;
    print (@Stringout);
    Hope that helps you.

    Quote Originally Posted by init0007
    I am trying to use the split function to replace a string in the format mm/dd/yyyy, but, when i use the following code,

    @Stringout = split /\\//,$Stringinp;

    The output is ddyyyy and i lose mm...

    what am i doing wrong? i was looking through documentation and all it says is that i need to use a "\" when using special chars.

    Thanks.

Posting Permissions

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