The principle is to truncation a character to see if its ascII code is greater than 128. If yes, it indicates that the truncation is a full-angle Chinese character, then a truncation is taken back. Use $ length to control the length
Note: cyclically Judge> 128 in a string
The number of characters. if The halfwidth character is an even number, it indicates that the position is exactly the whole Chinese character. if it is an odd number, it is half a Chinese character and the next word is required.
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