本文介绍了双反斜杠替换为单反斜杠,然后转换为俄语字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
string strOriginal;
string strReplace;
strOriginal = "01acdfb\\pallavi";
strReplace = strOriginal.Replace(@"\\", @"\");
Label1.Text = strReplace;
它以单反斜杠形式给我输出,但实际上,它不会将其转换为单斜杠形式,这会影响我的下一步,因为在获得单斜杠输出后,我的另一个要求是我必须将该单斜杠unicode字符串转换为俄语代码
its give me output in single backslash form but in actual, it will not convert it into single slash form it affect my next step because after getting that single slash output my another requirement is that i have to convert that single slash unicode string into russian code
推荐答案
strOriginal = "01acdfb\\pallavi";
strOriginal_v2 = @"01acdfb\pallavi"; // There 2 are the same in nature they both have same string
然后
then
strReplace = strOriginal.Replace(@"\\", @"\");
不会执行任何操作,因为那里没有双反斜杠.
Will do NOTHING because there is no double backslash there.
这篇关于双反斜杠替换为单反斜杠,然后转换为俄语字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!