www.webdeveloper.com
Results 1 to 3 of 3

Thread: Detect hyphen at end of string

  1. #1
    Join Date
    Sep 2007
    Posts
    60

    Detect hyphen at end of string

    Hi guys

    I hope you can help me out with this.

    I need to detect if a string has a hyphen at the end of it.

    ---------------

    Eg:

    Mystring = "the quick brown fox-"

    If a hyphen exists at the end of the string then...

    Do this

    If a hyphen does not exist at the end of the string then...

    Do that

    --------------


    How would I achieve this? Any help would be fully appreciated.

    Best regards

    Rod from the UK

  2. #2
    Join Date
    Sep 2007
    Posts
    60
    Hi guys

    I have managed to find a suitable solution.

    Best regards

    Rod from the UK

  3. #3
    Join Date
    Jan 2008
    Location
    Florida
    Posts
    1,227
    If right(Mystring,1) = "-" then

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles