May be you only understand what are you trying to do.
debasisdas
Posting Genius
6,968 posts since Feb 2007
Reputation Points: 722
Solved Threads: 457
Skill Endorsements: 20
See if this helps.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
With TextBox1
.Text = "123|456" '// FOR TESTING.
For Each c As Char In .Text '// loop thru all char.s.
If Char.IsDigit(c) Then .Text = .Text.Replace(c, "*") '// .Replace char. with your char..
Next
End With
End Sub
codeorder
Postaholic
2,124 posts since Aug 2010
Reputation Points: 256
Solved Threads: 387
Skill Endorsements: 8
Works here just fine.
Try explaining the issue and not just saying sh.t don't work.
Just wondering, is it changing all #'s in the entire TextBox and you only need to change the #'s on the lines that .Contains("|")?
AndAlso, change only the first 3 #'s before the "|" and the 3 #'s after?
Hope this helps to solve your issue, although it should have been info provided by you already.
p.s. Welcome to an "IT" forum.:)
codeorder
Postaholic
2,124 posts since Aug 2010
Reputation Points: 256
Solved Threads: 387
Skill Endorsements: 8
Question Answered as of 1 Year Ago by
codeorder,
debasisdas
and
kingsonprisonic I just finished putting this together. Hope it helps.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
replaceText(TextBox1)
End Sub
Private Sub replaceText(ByVal myCoolTextBoxToReplaceIn As TextBox)
Dim iSi As Integer, sTemp As String
With myCoolTextBoxToReplaceIn
Do Until iSi >= .TextLength
If .Text.Substring(iSi).Contains("|") Then
iSi = .Text.IndexOf("|", iSi)
sTemp = .Text.Substring(iSi - 3, 7)
.Text = .Text.Replace(sTemp, "***|***")
MsgBox(sTemp) '// get value.
End If
iSi += 1
Loop
End With
End Sub
codeorder
Postaholic
2,124 posts since Aug 2010
Reputation Points: 256
Solved Threads: 387
Skill Endorsements: 8
codeorder
Postaholic
2,124 posts since Aug 2010
Reputation Points: 256
Solved Threads: 387
Skill Endorsements: 8