使用C#进行字符串解析

And*_*dre -1 c# string

我是C#的初学者,我想只"title"从字符串中提取字符串:"http://playdebug.games.com/facebook/title.html"

And*_*ndy 6

我建议使用Path.GetFileNameWithoutExtension()

String toParse = "http://playdebug.games.com/facebook/title.html";
String result = Path.GetFileNameWithoutExtension(toParse);
Run Code Online (Sandbox Code Playgroud)

  • @OndrejTucny不,它也适用于URI. (2认同)