borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (I could not delete the file)Next Topic (User-Agent in INET Control) New Topic New Poll Post Reply
AndreaVB Forum : VB General : Best Alternative to Trim()
Poster Message
suryasatya
Level: Big Cheese

Registered: 08-08-2006
Posts: 20

icon Best Alternative to Trim()

Hi All,



can any one suggest better alternative to statement like Len(Trim(string))>0. As we know Trim operation is very complex one ane we are using same statement so many places in a loop.



Please suggest better solution/function which do the same task.



Thanks in advance,

Surya


____________________________
surya satya

20-07-2007 at 01:33 PM
View Profile Send Email to User Show All Posts | Quote Reply
VYX
Level: Professor


Registered: 16-12-2005
Posts: 70
icon Re: Best Alternative to Trim()

Hi..

Some other functions could do the same output but it depends of the user and where you going to do it..

mid,right,left and other functions can be


There are so many members here who can help you If you're going to post your complete and very specific problem.


Im sorry it's not clear to me what probably you want to be.

-VYX-

--------------------------------
"Genius is 1 percent inspiration but 99 percent perspiration"
by Thomas Edison

23-07-2007 at 03:16 AM
View Profile Send Email to User Show All Posts | Quote Reply
stickleprojects
Level: Moderator


Registered: 09-09-2002
Posts: 891
icon Re: Best Alternative to Trim()

Hi,
The following will be quicker.. although how much is quite marginal.


dim i as long
for i=len(s) to 0
   if asc(mid$(s,i,1))<>32 then exit for
next i

s = left$(s,i)


Hope this helps,
Kieron


____________________________
Build it better, faster, quicker, easier.. then fix it (non-offical MS mission statement)

23-07-2007 at 11:28 AM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : VB General : Best Alternative to Trim()
Previous Topic (I could not delete the file)Next Topic (User-Agent in INET Control) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder