Please Help me in creating a replace function.
Problem:
Their is a alphanumeric value of any length (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 equals to count of length of str - 4
end function
What’s a better function to perform such an operation?
Try this on for size.