运行以下代码时收到此消息:
XML文档中存在错误(6,22).
namespace N1
{
public class InputEntry
{
//FieldName is a class tht is generated from an XSD which has complex type Name and value
private Field fields;
public Field[] Fields
{
get { return this.fields; }
set { this.fields= value; }
}
public string FieldName
{
get{return this.fieldName;}
set { this.fieldName = value; }
}
public string FieldValue
{
get {return this.fieldValue; }
set {this.fieldValue = value;}
}
}
public class B
{
public void Method1()
{
InputEntry …Run Code Online (Sandbox Code Playgroud) 我有一个字符串.我想搜索一个斜杠,然后用"\"(双斜杠)替换"\"(单斜杠).
string Method1(string s)
{
string upadtedString = s;
if (s.Contains("\\"))
{
//do nothing
}
else if(s.Contains("\"))
{
string s1 = "\";
string s2 = "\\";
upadtedString.Replace(s1,s2);
s = upadtedString;
}
return s;
}
Run Code Online (Sandbox Code Playgroud)
`