Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Alternative to Mid()
Message
From
12/10/2010 12:17:58
 
 
To
12/10/2010 11:39:17
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:
01484803
Message ID:
01485007
Views:
36
>>[I have not installed vs2010 on my new computer yet - so I cannot test]
>>
>>If you use a lot of mid() it will be slow. The reason is - I think - that each call creates another string (object)
>>
>>Can you use one char at a time ? If yes, why not index the string
>>
>>char c ;
>>string s = "very long string";
>>
>>c = s[5];
>>
>
>We are talking at thousands of MID() which have to be done in a flash. The string is also in the range of 20k. So, I am not sure if this would be any better. This is a highly complex algorythm. The best would be to have the StringBuilder to include a Mid() function. But, this is not supported yet.

Actually, there is http://msdn.microsoft.com/en-us/library/fyx7s61s.aspx
string xx = sb.ToString(startIndex, length);
You can even make an extension method


But why do you need that many mid's ?
Gregory
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform