Replace

Use -

VB Code:
  1. [i][b][string][/b][/i] = Replace([b][i][expresion][/i][/b],[b][i][find][/i][/b],[b][i][Replace With][/i][/b])

[string] - This will hold the result of our Replace() function[expresion] - This is the expresion we we be changing (a text box or label or "23.78.09" etc[find] - This is what we will be changing[Replace With] - and this is what we will be chnaging it to

Example -


Lets say we have a textbox (Named text1) and it contains (12.7.90.50) and for whatever reason we need to change the '.' (period) to a '/' (forward slash)

VB Code:
  1. myString = Replace(Text1.Text, ".", "/")
  2.  msgbox MyString

MyString would be 12/7/90/50,

Please note it would not change the contents of the textbox, to change the contents of the textBox you would need to do this.


VB Code:
  1. text1.text = Replace(Text1.Text, ".", "/")