- Func<string, string> ReverseString = delegate(string s)
- {
- char[] word = s.ToCharArray();
- for (int i = 0, j = (s.Length - 1); i < j; i++, j--)
- {
- char _temp = word[i];
- word[i] = s[j];
- word[j] = _temp;
- }
- return new string(word);
- };
- //该片段来自于http://www.codesnippet.cn/detail/180720134685.html
来源: http://www.codesnippet.cn/detail/180720134685.html