>>>>Out of curiosity : can you provide an example of the input string ?
>>>
>>>An example of an input string is usually a SQL select such as:
>>>
>>>SELECT Member.FirstName,Member.LastName,Member.Bann,Member.Register,Member.Blog,Member.Cie,Member.NoProvince,
>>> Province.Title_E AS Province,Country.Title_E AS Country,Member.City,Member.NoCountry,Member.Http,Member.LastAccess
>>> FROM Member (NOLOCK)
>>> LEFT JOIN Province ON Member.NoProvince=Province.Numero
>>> INNER JOIN Country ON Member.NoCountry=Country.Numero
>>> WHERE Member.Numero=@Numero
>>
>>I'm being dumb. If, in the context of your code snippet, that is lcString then what is lcWord. Or, more simply - what would the required output look like?
>
>lcString is as shown above. lcWord is a variable holding a reserved word from SQL Server. So, I have a list of reserved word. This is why there is a For/Next loop where lcWord is changing all the time. So, the For/Next loop scans each word to see if they are in the string. If they are, they will be adjusted with [Table] or [Field] for example.
So wouldn't this do the same thing:
lcString = lcString.Replace(lcWord + ".", "[" + lcWord + "].")