|
-
Sep 8th, 2011, 12:39 AM
#1
Thread Starter
Lively Member
Help help help!!!
I want to know how to put (-) AFTER the word LOVE AND before Any word in the textbox by a click of Button. (
if my textbox1.text has: LOVEMOM then when i click the "Button" it shows "LOVE-MOM"
if LOVEDAD then = "LOVE-DAD" and soo on.
Thank you very much for helping.
-
Sep 8th, 2011, 12:50 AM
#2
Addicted Member
Re: Help help help!!!
Try this
vb Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim _strfull$ = TextBox1.Text.ToString Dim _Love$ = _strfull.Substring(0, 4) Dim _conct$ = String.Concat(_Love, "-", _strfull$.Substring(4, Len(_strfull) - 4)) TextBox1.Text = _conct$ End Sub
-
Sep 8th, 2011, 01:05 AM
#3
Thread Starter
Lively Member
Re: Help help help!!!
Another question is that if i type in the Textbox "ILOVEYOUMOM" and i want to remove the first 8 letter by 1 click of button, how do i do it 
thanks so much
-
Sep 8th, 2011, 01:12 AM
#4
Addicted Member
Re: Help help help!!!
ooh please using SubString method like this..
vb Code:
Dim _strng$ = "ILOVEYOUMOM" MsgBox(_strng.Substring(8, Len(_strng) - 8))
-
Sep 8th, 2011, 01:15 AM
#5
Thread Starter
Lively Member
Re: Help help help!!!
I meant like if i copy "ILOVEYOUMOM" and paste to the textbox1 and click button1 then the textbox1.text should be "MOM" only cuz its -8 letters.
can u show me the full method cuz i'm newbie 
thanks for your advance
-
Sep 8th, 2011, 01:20 AM
#6
Addicted Member
Re: Help help help!!!
vb Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim _strng$ = TextBox1.Text If Trim(_strng) <> String.Empty Then If Len(_strng) >= 8 Then TextBox1.Text = _strng.Substring(8, Len(_strng) - 8) End If End If End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|