You can easily complement a string using PadLeft and PadRight in C #.
PadLeft (int totalwidth, char Paddingchar)//To the left of the string to complement totalwidth length with Paddingchar
PadLeft (int totalwidth, char Paddingchar)//to the right of the string to complement totalwidth length with Paddingchar
For example:
1, string aa = "WU";
string bb = aa. PadLeft (6)//Right aligns the characters in this instance, padding on the left with spaces to reach the specified total length.
string cc = AA. PadLeft (6, ' 0 ');/Right aligns the characters in this instance, padding on the left with the specified Unicode character to reach the specified total length.
2, pznm = (snode. innertext). ToString (). PadLeft (10, ' 0 ');
The string is fixed to 10 bits, and less than 10 bits to the left complement 0.
This paper url:http://www.bianceng.cn/programming/csharp/201410/45590.htm