Comparing strings with spaces


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Comparing strings with spaces

  1. #1
    Christ Guest

    Comparing strings with spaces


    Hi
    Is there any way to compare two strings with spaces in jscript? eg:
    if("New York"=="New York"){

    The strings aren't constants, they are in variables.

    Thanks.



  2. #2
    Lior Amar Guest

    Re: Comparing strings with spaces

    Ok I'll bite...I just ran your example cause it seemed to me like it should
    work (simple string comparisons) and it works. I then put them in var a and
    var b and tried it and it works. What doesn't work?


    --
    Lee Amar
    Chief Technology Officer
    www.ostnet.com
    OSTnet OpenSource Technologies Inc
    lior@ostnet.com
    OSTnet develops software and subcontracts much of the work to registered
    developers over the Internet. Members of www.ostnet.com are free to view all
    company projects open for tender (in the Projects section of the Developer
    Home) and can apply to work on these projects. We prequalify all of our
    members to determine their level and areas of expertise. Please feel free to
    sign up at your leisure and write the exams in order to qualify yourself for
    OSTnet projects.




    "Christ" <kryzthian@hotmail.com> wrote in message
    news:39f86caa$1@news.devx.com...
    >
    > Hi
    > Is there any way to compare two strings with spaces in jscript? eg:
    > if("New York"=="New York"){
    >
    > The strings aren't constants, they are in variables.
    >
    > 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
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center