Hello All, Experts,
I want to mask the value with "XXXXX" but how to.
suppose i get value in string with different lengths , i.e. sometime 3 characters or more than 10 characters.
i want to mask each character with X till no.of characters.
*This post is locked for comments
static void Main(string[] args)
{
string input = "779";
string maskvalue = string.Empty;
if (!string.IsNullOrEmpty(input))
{
for (int i = 0; i < input.Length; i++)
{
maskvalue =maskvalue+ "X";
Console.WriteLine("{0}",input[i]);
Console.WriteLine("{0}", maskvalue);
}
}
Console.ReadKey();
}
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156