Quantcast
Viewing all articles
Browse latest Browse all 12

Answer by JaredPar for Quickest Method to Reverse in String in C#.net

public static String Reverse(string input) {  var length = input.Length;  var buffer = new char[length];  for ( var i= 0; i < input.Length; i++ ) {    buffer[i] = input[(length-i)-1];  }  return new String(buffer);}

EDIT: Doh! Forgot to halve the length for perf :)


Viewing all articles
Browse latest Browse all 12

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>