Results 1 to 3 of 3

Thread: String Manipulations

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Nov 2000
    Posts
    21

    Smile

    Hi,
    I coded a little function called TCase to convert a sentence's case to Title Case. I coded it using strings, and it does work fine. But when I started using sentences that exceed 5 KB it became dead slow. A 3 KB sentence will take 1 sec to process, while a 30 KB sentence will take 2 minutes easily. I was upset. So I recoded the whole function once again using arrays. Now a 100 KB sentence takes 0.5 secs hardly, and boy I was pleased.

    This is my question:
    How does VB handle strings internally in comparison to arrays, and why is the difference in string manipulation speed.
    I'd appreciate any tips that could optimize string manipulations in VB.
    Thanks.
    Rabih Waked
    Using Visual Basic 6 Enterprise Edition with SP4.
    The clock is ticking, the end of days
    A journey awaits...

  2. #2
    Guest

    Wink Have a look at

    vbs strconv function, may be save yourself some work.

    Just a suggestion.

  3. #3
    Guest

    Wink Oops fogot to mention

    If you want to convert

    text = "the quick brown fox"

    to

    text = "The Quick Brown Fox"

    then use

    text = strconv(text,vbProperCase)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width