我有一个简单的问题,我做了一些研究,但找不到合适的答案.
我有这个字符串:
|她想吃早餐|
我找到了|
用另一个角色替换所有角色的答案.
我的想法是,我想,以取代第一|
与{
最后一个用}
.
我知道这很容易,但我对这个问题的答案真的会帮助我.
提前致谢.
我想做一个这样做的C#应用程序:
很简单,但不能让它工作.
这是我的代码:
string[] files = Directory.GetFiles(folderBrowserDialog1.SelectedPath);
foreach (string file in files)
{
MessageBox.Show(Path.GetFullPath(file));
//string path=Path.Combine(Path.GetFullPath(file), "results");
//MessageBox.Show(path);
string path2 = Path.GetDirectoryName(file);
path2 = Path.Combine(Path.GetDirectoryName(file), @"results\");
path2 = Path.Combine(path2, file);
MessageBox.Show(path2);
}
Run Code Online (Sandbox Code Playgroud) 我对正则表达式不太满意,我在这里只有一个简单的问题.
我有这样一个链接列表:
http://domain.com/andrei/sometext
http://domain2.com/someothertext/sometextyouknow/whoknows
http://domain341.com/text/thisisit/haha
Run Code Online (Sandbox Code Playgroud)
我只想要两个正则表达式来解决这个问题:
http://domain.com/andrei/
http://domain2.com/someothertext/
http://domain341.com/text/
Run Code Online (Sandbox Code Playgroud)
这是我需要的第一个正则表达式,我需要另一个正则表达式来取出域名,但我想如果有人能告诉我正则表达式只取出我写的内容,我会想出来的.