How to delete characters and append strings?
- by devin250
i am adding a new record to xml file
im first quering all existing items and storing the count in an int
int number = query.count()
and then incrementing number by 1;
number = number +1;
now i want to format this value in a string having "N00000000" format
and the number will ocuppy the last positions
Pseudo code:
//declare the format string
sting format = "N00000000"
//calculate the length of number string
int length =number.ToString().Length();
// delete as many characters from right to left as the length of number string
???
// finally concatenate both strings with + operator
???
help please