SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Guru afridy's Avatar
    Join Date
    Mar 2007
    Posts
    966
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    String Issue - Very Agent friends

    hai all,

    the thing is, i have a date string like this : 12/10/2008

    i just want to make sure there are two /'s in the string.

    please help.

  2. #2
    SitePoint Guru
    Join Date
    Sep 2006
    Posts
    731
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by afridy View Post
    hai all,

    the thing is, i have a date string like this : 12/10/2008

    i just want to make sure there are two /'s in the string.

    please help.
    You could increase the stringency of your test, but:
    Code:
    if( myString.match(/\/\d+\//) )
     {/*found two slashes with at least one digit between them*/}
    Tab-indentation is a crime against humanity.

  3. #3
    SitePoint Guru afridy's Avatar
    Join Date
    Mar 2007
    Posts
    966
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Thanks logic ali.
    ill check it


Bookmarks

Posting Permissions

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