473,473 Members | 1,757 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

A test about searching in a String I promised Jay B.

Cor
Hallo,

I have promised Jay B yesterday to do some tests.

The subject was a string evaluation that Jon had send in. Jay B was in doubt
what was better because there was a discussion in the C# newsgroup on 25
September. The regular expressions where in that newsgroup too involved.

I told yesterday night, to Jay that I would test all 4 methods and the
stupid method I was thinking of the first time that night when I saw Jon's
code. Herfried said from that, that it would become slow with a string from
10Mb. So I told Herfried that I would make the test program if he would type
in a real mixed string for me. But till now he did not send that. (Or maybe
he has again problems with the newsgroup server)

To Jay B I told also that I would try to test extra the difference between
the Microsoft.visual basic function Instr and the system function indexof.

The methods I tested were:
- a do until method with index of (Jay B)
- a do method with Instr (Jon)
- the same I changed something to indexof (Jon)
Those works all with strings
The others only with characters as a search item
- a stupid method that only needs 2 lines code what became in my thoughts
yesterday night
- a indexof with a char (Jay B)
- a for each with a char (Jay B)
I made a test program that I send with this message beneath.
Because all is dependable on the computer you use, I don't give absolute
figures if you wish you can try it yourself. On my computer it is impossible
to see with any method a difference from more than 1/1000 of a second with a
string shorter than 5000 characters.
With more than that amount of characters that the stupid method I thought of
yesterday becomes visible slower.

When it are real long strings, than with a charsearch was in my test the
fastest method the "do for loop" with "indexof" and second was the for "each
char" both from Jay B.

But for me the most surprising was that the Microsoft.visualbasic function
with "Instr" from Jon was almost 2 times faster with a 3 character string
than the net.system method "indexoff".

I do the test program beneath; it is made with a windowsform project, and
need 2 textboxes from which textbox1 needs to have multi line true, a
button1 and a large label1.

Texbox1 is for the text to make a string with (automaticly made till
Herfried send his in).
Textbox2 the length of the text string to make (Yes you understand it
till....)

I hope this gives some idea's (too about some people who said the
microsoft.visualbasic functions are slow and outdated, This you can of
course not test with C#.)
Cor
\\\
Private Sub Button1_Click(ByVal sender _
As Object, ByVal e As System.EventArgs) Handles Button1.Click
If Me.TextBox1.Text = "" Then
Me.label1.Text = "Enter strings in uper textbox"
Exit Sub
End If
If Not IsNumeric(Me.TextBox2.Text) Then
Me.label1.Text = "Enter value in down textbox"
Exit Sub
End If
TestString.Build(Me.TextBox1.Text.ToString, CInt(Me.TextBox2.Text))
Dim delimiter As String
If TestString.StringToTest.Length > 3 Then
delimiter = TestString.StringToTest.Substring(0, 3)
Else
Exit Sub
End If
Dim i As Integer
Dim labeltext As New System.Text.StringBuilder
Dim count As Integer
Dim testname As String
For i = 1 To 3
Dim StartTick As Integer = Environment.TickCount
Select Case i
Case 1
testname = "Jay B, string "
count = Test1(TestString.StringToTest, delimiter)
Case 2
testname = "Jon, string "
count = Test2(TestString.StringToTest, delimiter)
Case 3
testname = "Jon, but with indexof"
count = Test3(TestString.StringToTest, delimiter)
End Select
Dim Elapsed As Integer = Environment.TickCount - StartTick
labeltext.Append(testname & "count: " & _
count & " Elapsed : " & Elapsed.ToString & vbCrLf)
Next
delimiter = delimiter.Substring(0, 1)
labeltext.Append("characters" & vbCrLf)
For i = 1 To 6
Dim StartTick As Integer = Environment.TickCount
Select Case i
Case 1
testname = "Jay B, string "
count = Test1(TestString.StringToTest, delimiter)
Case 2
testname = "Jon, string "
count = Test2(TestString.StringToTest, delimiter)
Case 3
testname = "Jon, but with indexof "
count = Test3(TestString.StringToTest, delimiter)
Case 4
If TestString.StringToTest.Length < 599999 Then
testname = "Cor stupid "
count = Test4(TestString.StringToTest, delimiter)
Else
testname = "Skipped test"
End If
Case 5
testname = "Jay B char do until "
count = test5(TestString.StringToTest, delimiter)
Case 6
testname = "Jay B char for each "
count = test6(TestString.StringToTest, delimiter)
End Select
Dim Elapsed As Integer = Environment.TickCount - StartTick
labeltext.Append(testname & "count: " & _
count & " Elapsed : " & Elapsed.ToString & vbCrLf)
Next
Me.label1.Text = labeltext.ToString

End Sub
Private Sub Form1_Load(ByVal sender As Object, ByVal _
e As System.EventArgs) Handles MyBase.Load
Me.Button1.Text = "start test"
End Sub
Public Function Test1(ByVal input As String, ByVal delimiter _
As String) As Integer 'Jay B 1(string)
Dim count, index As Integer
index = input.IndexOf(delimiter)
Do Until index < 0
count += 1
index = input.IndexOf(delimiter, index + 1)
Loop
Return count
End Function
Public Function Test2(ByVal strInput As String, ByVal strDelimiter _
As String) As Int32 'Jon (string)
Dim iStart As Int32, iCount As Int32, iResult As Int32
iStart = 1
iCount = 0
Do
iResult = InStr(iStart, strInput, strDelimiter)
If iResult = 0 Then Exit Do
iCount += 1
iStart = iResult + 1
Loop
Return iCount
End Function
Public Function Test3(ByVal input As String, ByVal delimiter _
As String) As Integer 'Jon with indexof(x,x,x)
Dim iStart As Int32, iCount As Int32, iResult As Int32
iStart = 0
iCount = 0
Do
iResult = input.IndexOf(delimiter, iStart)
If iResult = -1 Then Exit Do
iCount += 1
iStart = iResult + 1
Loop
Return iCount
End Function
Public Function Test4(ByVal input As String, ByVal delimiter _
As String) As Integer 'Cor stupid
Dim teststring As String() = Split(input, delimiter)
Return teststring.Length - 1
End Function
Public Function test5(ByVal input As String, ByVal _
delimiter As Char) As Integer 'Jay 1(char)
Dim count, index As Integer
index = input.IndexOf(delimiter)
Do Until index < 0
count += 1
index = input.IndexOf(delimiter, index + 1)
Loop
Return count
End Function
Public Shared Function test6(ByVal input As String, _
ByVal delimiter As Char) As Integer 'JayB 2(char)
Dim count As Integer
For Each ch As Char In input
If ch = delimiter Then
count += 1
End If
Next ch
Return count
End Function
End Class
Public Class TestString
Private Shared mStringTest As String
Public Shared ReadOnly Property StringToTest() As String
Get
Return mStringTest
End Get
End Property
Public Shared Sub Build(ByVal strToTest As String, ByVal x As Integer)
Dim strTest As New System.Text.StringBuilder
Dim strTextbox As String() = Split(strToTest, vbCrLf)
Do While strTest.ToString.Length < x
Dim i As Integer
For i = 0 To strTextbox.Length - 1
Dim y As Integer
For y = 0 To i
If strTest.ToString.Length < x / 2 Then
strTest.Append(strTest.ToString & strTextbox(i))
Else
strTest.Append(strTest.ToString.Substring(0, x / 2) _
& strTextbox(i))
End If

Next
Next
Loop
mStringTest = strTest.ToString.Substring(0, x)
End Sub
End Class
///
Nov 20 '05 #1
35 2523
Hi Cor,

|| Herfried said from that, that it would become slow
|| with a string from 10Mb. So I told Herfried that I
|| would make the test program if he would type in a
|| real mixed string for me. But till now he did not send
|| that. (Or maybe he has again problems with the
|| newsgroup server)

I've just been speaking to Herfried at the Hospital - it's not looking
good. He got as far as character 432764 before the pain was too much to bear.
The doctors have diagnosed the most severe case of RSI that they have seen in
years. Not surprising when Herfried was typing as fast as he couldto get you
the file in time. Unfortunately amputation may be the most reasonable outcome.
:-((

Regards,
Fergus
Nov 20 '05 #2
"Fergus Cooney" <fi******@tesco.net> scripsit:
Herfried said from that, that it would become slow
with a string from 10Mb. So I told Herfried that I

I told that it will consume a lot of memory, but I never told that the
performance will be bad.
I've just been speaking to Herfried at the Hospital
- it's not looking good. He got as far as character
432764 before the pain was too much to bear. The doctors
have diagnosed the most severe case of RSI that
What's RSI?
they have seen in years. Not surprising when Herfried was
typing as fast as he couldto get you the file in time.
Unfortunately amputation may be the most reasonable outcome.
:-((


:-(

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #3
Hi Herfried,

Repetitive Strain Injury - what you get from typing too much for too long.
How's the wrist now - do the doctors still think the hand will have to come
off? ;-)

Regards,
Fergus
Nov 20 '05 #4
Cor
Because all is dependable on the computer you use, I don't give absolute
figures if you wish you can try it yourself. On my computer it is impossible to see with any method a difference from more than 1/1000 of a second with a string shorter than 5000 characters. When timing really fast functions like this, what you can do is put the
function in a loop, and call the function 1000 times, as long as you call
all the functions 1000 times you are safe to compare the amount of time they
took. You can increase the # of times you loop depending on how quick the
function. The danger becomes you start timing the loop itself and lose the
fact you are timing a function.

Jon Skeet a C# MVP wrote up the following on benchmarking, the samples are
in C# however the concepts should apply to VB.NET benchmarks.

http://www.yoda.arachsys.com/csharp/benchmark.html

BTW: Thank you for the code!

Hope this helps
Jay

"Cor" <no*@non.com> wrote in message
news:3f**********************@reader20.wxs.nl... Hallo,

I have promised Jay B yesterday to do some tests.

The subject was a string evaluation that Jon had send in. Jay B was in doubt what was better because there was a discussion in the C# newsgroup on 25
September. The regular expressions where in that newsgroup too involved.

I told yesterday night, to Jay that I would test all 4 methods and the
stupid method I was thinking of the first time that night when I saw Jon's
code. Herfried said from that, that it would become slow with a string from 10Mb. So I told Herfried that I would make the test program if he would type in a real mixed string for me. But till now he did not send that. (Or maybe he has again problems with the newsgroup server)

To Jay B I told also that I would try to test extra the difference between
the Microsoft.visual basic function Instr and the system function indexof.

The methods I tested were:
- a do until method with index of (Jay B)
- a do method with Instr (Jon)
- the same I changed something to indexof (Jon)
Those works all with strings
The others only with characters as a search item
- a stupid method that only needs 2 lines code what became in my thoughts
yesterday night
- a indexof with a char (Jay B)
- a for each with a char (Jay B)
I made a test program that I send with this message beneath.
Because all is dependable on the computer you use, I don't give absolute
figures if you wish you can try it yourself. On my computer it is impossible to see with any method a difference from more than 1/1000 of a second with a string shorter than 5000 characters.
With more than that amount of characters that the stupid method I thought of yesterday becomes visible slower.

When it are real long strings, than with a charsearch was in my test the
fastest method the "do for loop" with "indexof" and second was the for "each char" both from Jay B.

But for me the most surprising was that the Microsoft.visualbasic function with "Instr" from Jon was almost 2 times faster with a 3 character string
than the net.system method "indexoff".

I do the test program beneath; it is made with a windowsform project, and
need 2 textboxes from which textbox1 needs to have multi line true, a
button1 and a large label1.

Texbox1 is for the text to make a string with (automaticly made till
Herfried send his in).
Textbox2 the length of the text string to make (Yes you understand it
till....)

I hope this gives some idea's (too about some people who said the
microsoft.visualbasic functions are slow and outdated, This you can of
course not test with C#.)
Cor
\\\
Private Sub Button1_Click(ByVal sender _
As Object, ByVal e As System.EventArgs) Handles Button1.Click
If Me.TextBox1.Text = "" Then
Me.label1.Text = "Enter strings in uper textbox"
Exit Sub
End If
If Not IsNumeric(Me.TextBox2.Text) Then
Me.label1.Text = "Enter value in down textbox"
Exit Sub
End If
TestString.Build(Me.TextBox1.Text.ToString, CInt(Me.TextBox2.Text))
Dim delimiter As String
If TestString.StringToTest.Length > 3 Then
delimiter = TestString.StringToTest.Substring(0, 3)
Else
Exit Sub
End If
Dim i As Integer
Dim labeltext As New System.Text.StringBuilder
Dim count As Integer
Dim testname As String
For i = 1 To 3
Dim StartTick As Integer = Environment.TickCount
Select Case i
Case 1
testname = "Jay B, string "
count = Test1(TestString.StringToTest, delimiter)
Case 2
testname = "Jon, string "
count = Test2(TestString.StringToTest, delimiter)
Case 3
testname = "Jon, but with indexof"
count = Test3(TestString.StringToTest, delimiter)
End Select
Dim Elapsed As Integer = Environment.TickCount - StartTick
labeltext.Append(testname & "count: " & _
count & " Elapsed : " & Elapsed.ToString & vbCrLf)
Next
delimiter = delimiter.Substring(0, 1)
labeltext.Append("characters" & vbCrLf)
For i = 1 To 6
Dim StartTick As Integer = Environment.TickCount
Select Case i
Case 1
testname = "Jay B, string "
count = Test1(TestString.StringToTest, delimiter)
Case 2
testname = "Jon, string "
count = Test2(TestString.StringToTest, delimiter)
Case 3
testname = "Jon, but with indexof "
count = Test3(TestString.StringToTest, delimiter)
Case 4
If TestString.StringToTest.Length < 599999 Then
testname = "Cor stupid "
count = Test4(TestString.StringToTest, delimiter)
Else
testname = "Skipped test"
End If
Case 5
testname = "Jay B char do until "
count = test5(TestString.StringToTest, delimiter)
Case 6
testname = "Jay B char for each "
count = test6(TestString.StringToTest, delimiter)
End Select
Dim Elapsed As Integer = Environment.TickCount - StartTick
labeltext.Append(testname & "count: " & _
count & " Elapsed : " & Elapsed.ToString & vbCrLf)
Next
Me.label1.Text = labeltext.ToString

End Sub
Private Sub Form1_Load(ByVal sender As Object, ByVal _
e As System.EventArgs) Handles MyBase.Load
Me.Button1.Text = "start test"
End Sub
Public Function Test1(ByVal input As String, ByVal delimiter _
As String) As Integer 'Jay B 1(string)
Dim count, index As Integer
index = input.IndexOf(delimiter)
Do Until index < 0
count += 1
index = input.IndexOf(delimiter, index + 1)
Loop
Return count
End Function
Public Function Test2(ByVal strInput As String, ByVal strDelimiter _
As String) As Int32 'Jon (string)
Dim iStart As Int32, iCount As Int32, iResult As Int32
iStart = 1
iCount = 0
Do
iResult = InStr(iStart, strInput, strDelimiter)
If iResult = 0 Then Exit Do
iCount += 1
iStart = iResult + 1
Loop
Return iCount
End Function
Public Function Test3(ByVal input As String, ByVal delimiter _
As String) As Integer 'Jon with indexof(x,x,x)
Dim iStart As Int32, iCount As Int32, iResult As Int32
iStart = 0
iCount = 0
Do
iResult = input.IndexOf(delimiter, iStart)
If iResult = -1 Then Exit Do
iCount += 1
iStart = iResult + 1
Loop
Return iCount
End Function
Public Function Test4(ByVal input As String, ByVal delimiter _
As String) As Integer 'Cor stupid
Dim teststring As String() = Split(input, delimiter)
Return teststring.Length - 1
End Function
Public Function test5(ByVal input As String, ByVal _
delimiter As Char) As Integer 'Jay 1(char)
Dim count, index As Integer
index = input.IndexOf(delimiter)
Do Until index < 0
count += 1
index = input.IndexOf(delimiter, index + 1)
Loop
Return count
End Function
Public Shared Function test6(ByVal input As String, _
ByVal delimiter As Char) As Integer 'JayB 2(char)
Dim count As Integer
For Each ch As Char In input
If ch = delimiter Then
count += 1
End If
Next ch
Return count
End Function
End Class
Public Class TestString
Private Shared mStringTest As String
Public Shared ReadOnly Property StringToTest() As String
Get
Return mStringTest
End Get
End Property
Public Shared Sub Build(ByVal strToTest As String, ByVal x As Integer)
Dim strTest As New System.Text.StringBuilder
Dim strTextbox As String() = Split(strToTest, vbCrLf)
Do While strTest.ToString.Length < x
Dim i As Integer
For i = 0 To strTextbox.Length - 1
Dim y As Integer
For y = 0 To i
If strTest.ToString.Length < x / 2 Then
strTest.Append(strTest.ToString & strTextbox(i))
Else
strTest.Append(strTest.ToString.Substring(0, x / 2) _
& strTextbox(i))
End If

Next
Next
Loop
mStringTest = strTest.ToString.Substring(0, x)
End Sub
End Class
///

Nov 20 '05 #5
Cor
Jay,
Thanks for the tip, but I am not intrested in differences between functions
who take less than 1/1000 of a second, if you are, we can try it.
Cor
When timing really fast functions like this, what you can do is put the
function in a loop, and call the function 1000 times, as long as you call
all the functions 1000 times you are safe to compare the amount of time theytook. You can increase the # of times you loop depending on how quick the
function. The danger becomes you start timing the loop itself and lose the
fact you are timing a function.

Nov 20 '05 #6
Cor
Herfried,
I am very sorry, I did not know that it would take such an amount of effort
for you to make that string.
Don't botter, I think that string of 422764 characters is as well as 10Mb,
other wise I just can do:
stringA = StringA + StringA + StringA and then it has enough characters to
do the test.

But lets not talk about those not so important things, more important is
your health.
I am worried about your hamster too, is somebode feeding it?

I hope the RSI is soon over.

Good luck

Cor

Nov 20 '05 #7
Good morning Cor. :-)

ROFL.

Regards,
Fergus
Nov 20 '05 #8
"Cor" <no*@non.com> scripsit:
I am very sorry, I did not know that it would take such an amount of effort
for you to make that string.
:-)
Don't botter, I think that string of 422764 characters is as well as 10Mb,
other wise I just can do:
stringA = StringA + StringA + StringA and then it has enough characters to
do the test.
Use "&" to concatenate a string. You you want it to be faster, use a 'StringBuilder'.
But lets not talk about those not so important things, more important is
your health.
I am worried about your hamster too, is somebode feeding it?
I feeded it in the morning.
I hope the RSI is soon over.


;-)

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #9
"Fergus Cooney" <fi******@tesco.net> scripsit:
Repetitive Strain Injury - what you get from typing too much for too long.
How's the wrist now - do the doctors still think the hand will have to come
off? ;-)


ROFLM*O

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #10
Hi Herfried,

|| Use "&" to concatenate a string.

What goes wrong if you don't ?

Regards,
Fergus
Nov 20 '05 #11
Cor,
It was more an FYI or even just for future reference.

Jay

"Cor" <no*@non.com> wrote in message
news:3f***********************@reader20.wxs.nl...
Jay,
Thanks for the tip, but I am not intrested in differences between functions who take less than 1/1000 of a second, if you are, we can try it.
Cor
When timing really fast functions like this, what you can do is put the
function in a loop, and call the function 1000 times, as long as you call
all the functions 1000 times you are safe to compare the amount of time

they
took. You can increase the # of times you loop depending on how quick the
function. The danger becomes you start timing the loop itself and lose thefact you are timing a function.


Nov 20 '05 #12
Cor
Herfried,
Don't botter, I think that string of 422764 characters is as well as 10Mb, other wise I just can do:
stringA = StringA + StringA + StringA and then it has enough characters to do the test.


Use "&" to concatenate a string. You you want it to be faster, use a

'StringBuilder'.

Thank you for the advice I will use that when you have sended the string.
:-)
Cor
Nov 20 '05 #13
Cor
Fergus,
|| Use "&" to concatenate a string.

What goes wrong if you don't ?

I was sure that Herfried would answer with this when I did make the sentence

And as a reserve I did not using stringbuilder so I was absolute sure.

I had my next answer already ready.
:-)))
Cor
Nov 20 '05 #14
"Cor" <no*@non.com> scripsit:
Use "&" to concatenate a string. You you want it to be faster, use a
'StringBuilder'.


Thank you for the advice I will use that when you have sended the string.
:-)


I'll send you a 200 MB string by mail if you give me your mail address.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #15
"Cor" <no*@non.com> scripsit:
Use "&" to concatenate a string.
What goes wrong if you don't ?


I was sure that Herfried would answer with this when I did make
the sentence


ROFL
And as a reserve I did not using stringbuilder so I was absolute sure.


I hope you know that the 'StringBuilder' would be the better choice.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #16
"Fergus Cooney" <fi******@tesco.net> scripsit:
Use "&" to concatenate a string.


What goes wrong if you don't ?


It's the preferred operator to do that in the Visual Basic .NET
programming language.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #17
Hi Herfried,

But that doesn't answer the question!!

Regards,
Fergus
Nov 20 '05 #18
ROFL
Nov 20 '05 #19
"Fergus Cooney" <fi******@tesco.net> scripsit:
But that doesn't answer the question!!


\\\
Dim s As String
s = "Hello " + 12 + 14 + " World"
///

What result would you expect?

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #20
"Fergus Cooney" <fi******@tesco.net> scripsit:
ROFL


I will send you a copy too...

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #21
Hi Herfried,

LOL, no it's all right thanks, I've almost finished typing mine up. :-)

Regards,
Fergus
Nov 20 '05 #22
Hi Herfried,

|| Dim s As String
|| s = "Hello " + 12 + 14 + " World"

I'd write
Dim s As String = "Hello 28 World"
or
Dim s As String = "Hello 1214 World"
depending on what I wanted.

It's interesting that the code produces a runtime Exception - I would have
thought that the compiler would be able to work out the discrepancy.
However,
s = "Hello " + " World"
vs

s = "Hello " & " World"

What's the difference? And we were talking about creating a huge string,
remember, no numbers involved. So I still have the question - why the emphasis
on '&'?

Regards,
Fergus
Nov 20 '05 #23
Cor
Herfried,
Now I know you did not try my test program, I was one of those who told you
that it is 10 times faster at least.
Or maybe you did know that before and I did not understand it.
Cor
Nov 20 '05 #24
Cor
Herfried,
How much time takes that with a 2Kb connection like you have?
I don't give it here, because of spammers.
(But my email is no secret, when you search with Google for Ligthert with
International language you have it direct,
I see my nephew Sacha has aranched it to become before me, but I will
correct that next week).
Cor
Nov 20 '05 #25
"Cor" <no*@non.com> scripsit:
How much time takes that with a 2Kb connection like you have?
I don't give it here, because of spammers.


I have a faster connection now (128,000 Kbps transmit rate).

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #26
"Cor" <no*@non.com> scripsit:
Now I know you did not try my test program, I was one of those who told you
that it is 10 times faster at least.
Or maybe you did know that before and I did not understand it.


I never got a test program. Maybe the message was lost because of the
server problems and didn't arrive on my computer?!

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #27
"Cor" <no*@non.com> scripsit:
How much time takes that with a 2Kb connection like you have?
I don't give it here, because of spammers.
(But my email is no secret, when you search with Google for Ligthert with


<http://home01.wxs.nl/~ligthert/plaatjes/persoonlijk_corfoto.jpg>

;-)

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #28
"Fergus Cooney" <fi******@tesco.net> scripsit:
However,
s = "Hello " + " World"
vs

s = "Hello " & " World"

What's the difference? And we were talking about creating a huge string,
remember, no numbers involved. So I still have the question - why the emphasis
on '&'?


Did you have a look at the MSIL with "ildasm"?

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #29
"Fergus Cooney" <fi******@tesco.net> scripsit:
LOL, no it's all right thanks, I've almost finished typing mine up. :-)


I am still typing with swollen fingers. If you finish typing, mail your
string to Cor.

;-)))

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #30
Cor
Herfried,
It is not important anymore, I tested it in a discussion, and the difference
is really high.
So now I am a fan from stringbuilder too,
I even know the reference to it withouth thinking.
:-))

But in the test I program, I did send in Friday I used in too.
With that I make automatic very fast strings from 10Mb or more and without
RSI.
I had expected an reaction from you, because with that test is shown, that
the microsoft.visual basic function "Instr" is twice as fast as the net
member "indexof", I had expect a reaction from you, but it was not.
It proves that a lot of people who talks about slower, or people like me who
say equeal, are wrong.
Cor
Nov 20 '05 #31
Hi Herfried,

ROFL - Poor fingers!!

I'm trying to get Cor's email but I'm not sure which Cor I'm looking for.

There seem to be plenty of Ligtherts here!!
http://home.planet.nl/~ligth204/home.htm

Regards,
Fergus
Nov 20 '05 #32
"Cor" <no*@non.com> scripsit:
But in the test I program, I did send in Friday I used in too.
With that I make automatic very fast strings from 10Mb or more and without
RSI.
I had expected an reaction from you, because with that test is shown, that
the microsoft.visual basic function "Instr" is twice as fast as the net
member "indexof", I had expect a reaction from you, but it was not.


That's really interesting. For some reason I didn't get your post...

:-(

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #33
"Fergus Cooney" <fi******@tesco.net> scripsit:
ROFL - Poor fingers!!

'm trying to get Cor's email but I'm not sure which Cor I'm looking for.

There seem to be plenty of Ligtherts here!!
http://home.planet.nl/~ligth204/home.htm


Cor's homepage.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #34
Cor
Herfried,
It is this thread ;-)))
But I think next time I leave out the fun part.
:-)
Cor
Nov 20 '05 #35
"Cor" <no*@non.com> scripsit:
It is this thread ;-)))
But I think next time I leave out the fun part.


;-)

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #36

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Mark Carter | last post by:
In v0.2.0 starting boa.py produces the error message: File "C:\Python23\Lib\site-packages\wxPython\tools\boa\About.py", line 301, in write ss = string.strip(s) NameError: global name 'string' is...
2
by: Roberto Dias | last post by:
Hi all, What to do for searching for more than one string occurrence in the same string (this last are line of a text). I have used getline(), to get the text lines by means of WHILE loop and...
1
by: Crimarc | last post by:
I come back to ask qustion what did he promised you that you soudned so much happy and sometime later so painful like you heart broken becase of his dificults ???? What did you sacrifice for C++...
34
by: Kishor | last post by:
Hi Friends Click here : www.c4swimmers.esmartguy.com to Test Your C Programming Strengths. You can find Tricky Questions on C, Interview type queries on C, Infrequently Answered Questions in C...
4
by: Pokerkook | last post by:
Hello, If anybody could help me with this I would greatly appreciate it. Or at least tell me why I get the output of this garbage: 49 49 10 49 52
11
by: HopfZ | last post by:
I coudn't understand some behavior of RegExp.test function. Example html code: ---------------- <html><head></head><body><script type="text/javascript"> var r = /^https?:\/\//g;...
17
by: Petyr David | last post by:
Just looking for the simplest. right now my perl script returns an error messge to the user if the date string is invalid. would like to do this before accessing the server. TX
18
by: Umesh | last post by:
Do you have any answer to it? thx.
3
by: yogi_bear_79 | last post by:
I'm sure I have a few things wrong here. But I am stuck on how to do a recurring search. Also my statement cin >quote; acts weird. If I enter more than one word it blows right past cin >findMe;...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.