vbnow Posted April 30, 2002 Posted April 30, 2002 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! Quote
*Gurus* divil Posted May 1, 2002 *Gurus* Posted May 1, 2002 That ought to work fine, although you can now use the Length and SubString methods of the String class. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
vbnow Posted May 3, 2002 Author Posted May 3, 2002 RE: Trimming text! still does not work! vb.net does not recognize "left" in the above code. Quote
*Gurus* divil Posted May 3, 2002 *Gurus* Posted May 3, 2002 Then try the other thing I suggested. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
Guest josuff247 Posted May 3, 2002 Posted May 3, 2002 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. Quote
Guest slyprid Posted May 21, 2002 Posted May 21, 2002 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 Quote
vbnow Posted May 21, 2002 Author Posted May 21, 2002 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: Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.