You can use regex
, as follows:
C #
string original = @"aaaaaaaaaa""aaaa""aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa""aaaaaaaaaa""aaaaaaaaaaaaa";
// percorre todas os valores que estejam entre aspas duplas
foreach (Match match in Regex.Matches(original, @"\""+[A-z].*?\""", RegexOptions.IgnoreCase))
{
// pega o valor encontrado e remove as aspas
string valorEncontrado = match.Value.Replace("\"", String.Empty);
// cria uma nova string do tamanho do valor encontrado
string novoValor = new String('b', valorEncontrado.Length);
// substitui o valor original pela nova string, re-adicionando as aspas
original = original.Replace(match.Value, "\"" + novoValor + "\"");
}
VB
Dim original As String = "aaaaaaaaaa""aaaa""aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa""aaaaaaaaaa""aaaaaaaaaaaaa"
For Each match As Match In Regex.Matches(original, """[A-z].*?""", RegexOptions.IgnoreCase)
Dim valorEncontrado As String = match.Value.Replace("""", String.Empty)
Dim novoValor As String = New String("b"c, valorEncontrado.Length)
original = original.Replace(match.Value, """" + novoValor + """")
Next
See working here in C # and here in VB a>.