>The following code is executed intensively:
>
>
> ' Check for the last occurence
> If Mid(lcString, lcString.Length - lcWord.Length) = "." + lcWord Then
> lcString = Mid(lcString, 1, lcString.Length - lcWord.Length) + "[" + lcWord + "] "
> End If
>
> ' Check for the first occurence
> If Mid(lcString, 1, lcWord.Length + 1) = lcWord + "." Then
> lcString = "[" + Mid(lcString, 1, lcWord.Length) + "]" + Mid(lcString, lcWord.Length + 1)
> End If
>
>
>Now, in order to fit some very long string, I have adjusted that method to use a StringBuilder instead.
>
>So, just before that code, instead of lcString, I have a loStringBuilder. This is the last part remaining in the conversion of that method. I am looking for the best way to convert that.
Are you using it to add delimiters for the column names and table names? Why not split on the . ?
BTW, there is a small typo in the comments in the word occurrence.
If it's not broken, fix it until it is.
My Blog