Linq Reverse a string

By [)ia6l0 iii

Use the ToCharArray with the Linq Reverse method.

string originalString = "eggheadcafe";
var reversedString = new string(originalString.ToCharArray().Reverse().ToArray());

Related FAQs

The LinQ SKIP operator lets you skip the results you want, and take the rest. See below for an code sample.
The LinQ Take operator lets you take only the results you want. See below for an code sample.
Linq Reverse a string  (668 Views)