Hi all I have a string
1234567789485116 and what I would like to do is to blank out every number apart from the last 5 so it would look like this **********85116 how would i do this?
Andy
Printable View
Hi all I have a string
1234567789485116 and what I would like to do is to blank out every number apart from the last 5 so it would look like this **********85116 how would i do this?
Andy
You can use String.Length to determine how long your String is. You can then use String.Substring to get the last 5 characters based on that length. You can also then create a new String of that same length full of asterisks. Finally, just concatenate those two substrings.