How to split a Java string at a backslash

String fname="C:\textfiles\db\query\query.txt";

this is the string i need to split it.

I tried with this

String [] items=fname.split("\");  

But not working.

String [] items=fname.split("\\"); also not working...

how to split this string...

This question and all comments follow the "Attribution Required."

All Answers

Answers Loading...
Leave a Reply
You must be logged in to post a answer.
About the author