This is my code:
if (e.ColumnIndex == 1 && e.Value != null)
{
e.Value = new String('*', e.Value.ToString().Length - 4);
}
The result of credit cardNo is ****************
I want to the result to be ************1234
How to do it?
This is my code:
if (e.ColumnIndex == 1 && e.Value != null)
{
e.Value = new String('*', e.Value.ToString().Length - 4);
}
The result of credit cardNo is ****************
I want to the result to be ************1234
How to do it?
var cardNo = e.Value.ToString();
var maskedCarNo = new String('*', cardNo.Length - 4) + cardNo[..4];