Cho chuỗi Welcome, sau khi đảo ngược thành emocleW.
Dùng Reverse() và LINQ:
Ví dụ
using System;
using System.Linq;
class Demo {
static void Main() {
string str = "Welcome";
string res = string.Join(" ", str.Split(' ').Select(s => new String(s.Reverse().ToArray())));
Console.WriteLine(res);
}
}