Reverses the specified input string. Correctly handles all UTF-16 strings The string to reverse. The reversed string.
(this string s)
| 244 | /// <param name="s">The string to reverse.</param> |
| 245 | /// <returns>The reversed string.</returns> |
| 246 | public static string Reverse(this string s) |
| 247 | { |
| 248 | string[] graphemes = s.GraphemeClusters().ToArray(); |
| 249 | Array.Reverse(graphemes); |
| 250 | return string.Concat(graphemes); |
| 251 | } |
| 252 | |
| 253 | /// <summary> |
| 254 | /// Removes any new line characters (\r or \n) from the string. |
no test coverage detected