How an I find LastIndexOf("\")

Dear Colleagues,

I am coding file upload form for our web.
I want to use LastIndexOf method to get a file name from  full path.
When I try to use LastIndexOf("\") it gives me an error.

Does anyone of you know how can I get an index of "\" from string.

Thanks in advance
Who is Participating?
ZvonkoConnect With a Mentor Systems architectCommented:
did you try:


It might be as simple as changing the function name to lastIndexOf (LastIndexOf is not a JavaScript function).
ZvonkoSystems architectCommented:
The backslash is an escape character. So to place the escape character itself you have to double it.
Terrible_macroAuthor Commented:
Great Job Zvonko
ZvonkoSystems architectCommented:
Thanks for points :)
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.