日期:2014-05-18 浏览次数:20994 次
public string swapChar(string s) { char[] newStr = s.ToCharArray(); newStr[0] = s[10]; newStr[1] = s[4]; newStr[10] = s[5]; newStr[4] = s[7]; newStr[8] = s[2]; newStr[10] = s[3]; return new string(newStr); }
using System.Linq; var newStr = new string(str.ToCharArray().OrderBy(e => Guid.NewGuid()));