Automatically fills in the length of the string and the length of the string.

Source: Internet
Author: User

Automatically fills in the length of the string and the length of the string.

Learning at work

C #:

String fullstr = hh. toString ("00000000"); or string fullstr = hh. toString (). padLeft (length, '0'); sqlserver: left (replicate ('0', 8-Len (parameter) + lTrim (parameter), 8) Note: '0' indicates the character used for completion, 8 indicates the length after completion, and '8-Len (parameter) 'indicates the number of characters to print, the user's account number is "00005555". When you enter the query condition, you can query the user without entering the previous '0'. That is, you can enter "5555" and the output result is "00005555"

 


C # questions about zero completion of undefined strings

Define an int variable:
Int aa = 111;

Convert the string to a 7-Bit String. The method is as follows:
String aastr = aa. ToString ("0000000 ");

Or

String aastr = aa. ToString (). PadLeft (7, '0 ');

Concatenates strings into a specific length for the assembly language.

Recent Compilation
This problem is very troublesome.
Then we despise the first-floor scammers.
I want to answer a lot because I am afraid to answer the question on the first floor.
It won't confuse people with code.
You did not lie to anyone in the code that you entered the string.
LZ careful

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.