When reversing a string manually I've always gone with a for loop:
var reversed = new char[a.Length] for(int i = a.Length - 1, j = 0; i >= 0 ; i --, j++){ reversed[j] = a[i]; } return reversed;
Not sure if this is faster but it's a lot easier to read in my opinion 😄
That is much much easier on the eyes! I'm bookmarking this solution.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
When reversing a string manually I've always gone with a for loop:
Not sure if this is faster but it's a lot easier to read in my opinion 😄
That is much much easier on the eyes! I'm bookmarking this solution.