Strings are immutable. You cannot replace a character. You can create a new string based on the previous one:
B4X:
Dim s As String = "abcdef"
s = StrReplaceAt(s, 2, "X")
Sub StrReplaceAt(str As String, Index As Int, Replacement As String) As String
Dim newStr As String = str.SubString2(0, Index) & Replacement
If Index < str.Length - 1 Then newStr = newStr & str.SubString(Index + 1)
Return newStr
End Sub