I wrote below code to reverse string , but it does not work. It says s[left] is read-only.
public string ReverseString(string s) {
int left = 0;
int right=s.Length - 1;
while(left < right){
char temp = s[left];
s[left] = s[right];
s[right] = temp;
left++;
right--;
}
return s;
}