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

H

Herfried K. Wagner [MVP]

Fergus Cooney said:
But that doesn't answer the question!!

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

What result would you expect?
 
F

Fergus Cooney

Hi Herfried,

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

Regards,
Fergus
 
F

Fergus Cooney

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
 
C

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
 
C

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
 
H

Herfried K. Wagner [MVP]

Cor said:
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).
 
H

Herfried K. Wagner [MVP]

Fergus Cooney said:
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.

;-)))
 
H

Herfried K. Wagner [MVP]

Fergus Cooney said:
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"?
 
H

Herfried K. Wagner [MVP]

Cor said:
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?!
 
C

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
 
H

Herfried K. Wagner [MVP]

Cor said:
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...

:-(
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top