I have this code:
string str = \"valta is the best place in the World\";
I need to replace the first symbol. When I try this:
Merged Chuck Norris's answer w/ Paulo Mendonça's using extensions methods:
///
/// Replace a string char at index with another char
///
/// string to be replaced
/// position of the char to be replaced
/// replacement char
public static string ReplaceAtIndex(this string text, int index, char c)
{
var stringBuilder = new StringBuilder(text);
stringBuilder[index] = c;
return stringBuilder.ToString();
}