c# - How can I split a string to obtain a filename? -


i trying split string. here string.

string filename =   "description/ask_question_file_10.htm" 

i have remove "description/" , ".htm" string. result looking "ask_question_file_10". have "/" , ".htm" appreciate help.

you can use path.getfilenamewithoutextension method:

string filename = "description/ask_question_file_10.htm";  string result = path.getfilenamewithoutextension(filename); // result == "ask_question_file_10" 

Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -