Title: [jdjlist] Re: String List Compare
When speed "is of the essence" :
(see highlighted part below)
----- Original Message -----
To: jdjlist
Sent: Wednesday, March 26, 2003 8:33 PM
Subject: [jdjlist] Re: String List Compare

Nothing.  Except I have to do 45000 of these... and the data is quite dirty as I metioned, and I am in no hurry to try and clean it up... and write the validation/cleanup routine for the new data... You can say I am somewhat lazy. hehehehe

I think of all the Java String operations I've tested, indexOf is nether the slowest, nor the fastest, clocking in at 15 miliseconds.  To contrast, String.equalsIgnoreCase is a hog, at 28 miliseconds, and String.equals is an acceptable 7 miliseconds, which is still far away from the coveted int == int is only 3 miliseconds.  (on my test strings, your results will vary).

[snip]

Greg

-----Original Message-----
From: Barzilai Spinak [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 26, 2003 10:57 AM
To: jdjlist
Subject: [jdjlist] Re: String List Compare


>I don't get it... what's wrong with String.indexOf(String)  ?
>It's not fast enough for you?  Or is there another problem that you
>have not stated?  

if the (possibly not consistent spacing) wasn't removed by a database operation, the found index wouldn't tell the exact position of the entry inside the list 

*if* spacing is removed , the whole operation might take too much time.

Perhaps counting the number of commata up to the index position ( found by String.indexOf(String)  ) in the string might help.

sincerely,

U. Penski

[EMAIL PROTECTED]

 

---
You are currently subscribed to jdjlist as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
http://www.sys-con.com/fusetalk

Reply via email to