2013-12-10 128 views

回答

1

这里另一种方式来做到这一点

字符串
string mystr = "Hello World"; 
     var arr = mystr.Split(';'); 
     string newMStr = string.Empty; 
     foreach (var s in arr) 
     { 
      string newS= s.Remove(0, 2); 
      newMStr+= Convert.ToChar(int.Parse(newS)); 
     } 

     //Print NewMstr 
+0

; (分号)在mystr结尾会导致错误。 – burhan

2

在.NET 4

System.Net.WebUtility.HtmlDecode(mystr) 
相关问题