Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Optimized way to transfer from String to StringBuilder
Message
From
04/02/2014 13:32:22
 
 
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:
01593165
Views:
26
>>>>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.
>>>
>>>UPDATE : I see you reached the same conclusion re: StringBuilder() :-}
>>>
>>>I don't think StringBuilder() will help. Regex() may be the way to go. Maybe Gregory, who has that off pat, will chip in - it's not my strong point :-{
>>
>>Aw - come on, Viv, Regex is fun
>
>Maybe - but I'm resigned to the fact that my brain doesn't work that way :-{
>Part of the problem is that I use it so rarely I have to 're-learn' from scratch every time....


Well, to be honest, I have to do that as well each time
Gregory
Previous
Reply
Map
View

Click here to load this message in the networking platform