Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Optimized way to transfer from String to StringBuilder
Message
From
05/02/2014 12:56:20
 
 
To
05/02/2014 12:39:37
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01593079
Message ID:
01593300
Views:
24
>>>>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 + "].")
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform