Please Help me to create a replace function in vb.net

Posted by Rajesh Rolen- DotNet Developer on Stack Overflow See other posts from Stack Overflow or by Rajesh Rolen- DotNet Developer
Published on 2010-04-01T09:57:34Z Indexed on 2010/04/01 10:13 UTC
Read the original article Hit count: 277

Filed under:
|

Please Help me in creating a replace function. Problem: Their is a alfanumeric value of any lenght (string) and i want to replace its all characters with 'X' except right four characters

Like : Value : 4111111111111111 Result Should be: XXXXXXXXXXXX1111

I have created a function but got stuck:

public function myfunction(str as string)
  str.Replace(str.Substring(0, str.Length - 5), 'X') 'but here i want no of x to be equvals to count of lenght of str - 4
end function

please tell me a better fuction to perform such a operation

© Stack Overflow or respective owner

Related posts about replace

Related posts about vb.net