string path =c:/document/abc.doc
this is my input string
i want the output only abc not .doc
can any one tell me the code for this plz

Recommended Answers

All 2 Replies

use split function

string output=path.Split('.');

If your question is regarding to file path and you want to get the name of file not an extension then use System.IO.Path.System.IO.Path.GetFileNameWithoutExtension(path).

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.