Java Script

Some String functions in Java Script



Here is Some String functions in Java Script

thisString.toLowerCase();

–>IT converts the string stored in the variable thisString to lower case.

thisString.indexOf(compareString)

— > Search for the occurence of the string stored in the variable compare string in the variable thisString.

For ex : if thisString =”abcd”

compareString=”bc”

The output will be 1 ( the index location of b)

This method returns -1 if the value to search for never occurs.

thisString.indexOf(compareString)

—>

This will find out the last occurance of the string compareString in thisString

For Ex: if thisString=”abcabcab”

compareString=”ab”

The output will be 6 (the index of last a)

Share

Thanks for reading my blog. If you like what I write, why not subscribe to my feed?

If you are busy, I can send the latest post to your email. Just subscribe to my email updates.

 

Enter your email address:

Delivered by FeedBurner

Discussion

One comment for “Some String functions in Java Script”

  1. [...] Today found this great post, here is a quick excerpt : Here is Some String functions in Java Script thisString.toLowerCase(); –>IT converts the string stored in the variable thisString to lower case. Read the rest of this great post Here [...]

    Posted by Some String functions in Java Script | For Technical Information « Script | February 3, 2010, 6:25 pm

Post a comment