How to replace last character of the string using c#?
<pre><code>string str = "Student_123_";
</code></pre>

<p>I need to replace the last character "_" with ",". I did it like this. </p>

<pre><code>str.Remove(str.Length -1, 1);
str = str + ",";
</code></pre>

<p>However, is it possible to achieve it more efficiently. may be one line of code.??
BTW, last character can be any character. So Replace wont work here.</p>
