Link to home
Start Free TrialLog in
Avatar of Victor  Charles
Victor CharlesFlag for United States of America

asked on

Help with copying partial data from textbox2 to textbox1 using vb.net

Hi,

How do you remove the first  4 characters in textbox2 and copy them to textbox1 using vb.net?
Thanks,
Victor
ASKER CERTIFIED SOLUTION
Avatar of Jacques Bourgeois (James Burger)
Jacques Bourgeois (James Burger)
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Victor  Charles

ASKER

Hi,

How do you delete the first 4 characters in textbox2 aftet you copy them to textbox1?

Thanks,

Victor
SOLUTION
Avatar of Fernando Soto
Fernando Soto
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you, will try both solutions and reply  tomorrow.
@Fernando.

Same thing as what I suggested an hour and a half ago. You simply used a shortened syntax that I never use, because I want consistencies in the syntax whether I am retrieving data at the start, the end or in the middle of a string.
@James, yes I agree.   ;=)
Thank You!
Hi,

How do I check if the first four characters in textbox2 are +\-999 (i.e +056 or -056) ? I need to transfer the data to text box1 only if this condition applies.

Thanks,

Victor
Not tested (sorry, no time)

If (TextBox2.Text.Substring(0, 1) = "+" OrElse TextBox2.Text.Substring(0, 1)="-" ) AndAlso IsNumeric(TextBox2.Text.Substring(1, 3))
Thank You.