Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I use to use this code to trim spaces like back spacing in vb6:

 

varlenght = Len(txtKeypad.Text) - 1

txtKeypad = Left(txtKeypad.Text, varlenght)

 

This does not work in vb.net.

Any suggestions please!!!

 

Thanks!

Guest josuff247
Posted

I am not 100% sure, but

I think that in vb.net

to use the left function you have to use it like this.....

 

Microsoft.Visualbasic.left(xxxxx,x,x)

 

Anystring.Substring seems to be a better way to do this.

  • 3 weeks later...
Guest slyprid
Posted

Try this:

 

varlenght = Len(txtKeypad.Text) - 1

txtKeypad = mid(txtkeypad.text,1,varlength)

 

I use mid() for trimming of spaces and grabbing certain info from a string. Alot easier in my opinion. Hope it helps.

 

Slyprid

Posted

Thanks slyprid!

 

Your sollution worked. I only I had to add the .Text to the txtKeypad because vb.net does not allow shortcuts like vb6.

 

Thanks again! :rolleyes:

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...