Судя по предоставленной позиции исходного кода 9
.
C # код:
var res = s.Substring(0, 9) + s.Substring(9).Replace("?????", "xxxxx");
VB.NET:
Dim res As String = (s.Substring(0, 9) & s.Substring(9).Replace("?????", "xxxxx"))
Пример VB.NET:
Using sr As StreamReader = New StreamReader("a.txt")
Using sw As StreamWriter = New StreamWriter("b.txt")
Dim line As String = Nothing
Do While (Not line = sr.ReadLine Is Nothing)
Dim res As String = (line.Substring(0, 9) & line.Substring(9).Replace("?????", "xxxxx"))
sw.WriteLine(res)
Loop
End Using
End Using
Пример C #:
using (var sr = new StreamReader("a.txt"))
{
using (var sw = new StreamWriter("b.txt"))
{
string line = null;
while ((line = sr.ReadLine()) != null)
{
var res = line.Substring(0, 9) + line.Substring(9).Replace("?????", "xxxxx");
sw.WriteLine(res);
}
}
}