I have File which has many lines related to bank account details. So while reading the file, sometimes the Account Number field is getting assigned with leading 0's as shown in this number 123456782135435000. Could you please suggest me how can I avoid leading 0's ?
the Exact Number should be - 123456782135435 but Most of the time account number will be in 16 characters. For example like this : 6689161615476256
This is the exsiting code where I am reading the line position in a file for the accountNumber
var accountNumber = Line.Substring(52, 16);
NewFileLine =
showToken => Line.Replace(Line.Substring(52, 16), showToken.PadRight(16))
Kindly let me know , how do I avoid the leading Zero's for the account number.
Kumar AUPosted Dec 13, 2020, 2:48 PM
Hi Sachin,
var accountNumber = Line.Substring(62, 16);
Here is the sample lines in the file, the one which I marked in Red color which are zero's which I need to eliminate while reading the file, please advise me
So the issue is 0000000124001369 instead I must ready only 124001369, but this happens very occasionally, most of the time starting from 62nd position we will have valid account number, please let me know how do I handle this situationKumar AUPosted Dec 13, 2020, 12:15 PM
Mageshwaran RPosted Dec 13, 2020, 12:01 PM
Sachin SinghPosted Dec 13, 2020, 11:56 AM