In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly introduces how to judge the length of a string in batch processing, which has a certain reference value. Interested friends can refer to it. I hope you will gain a lot after reading this article.
Exercise 1.1 the string length does not exceed 80. No special characters
Example i like the bathome,because here is the batch of the world.
1.2 the string length is less than 255 and contains special characters. Try to find its length.
For example,% a%% verfdxcweippo opj x ds gw & ^ * ~ are you o k? ":\ / ``verdict!%%
In general, ask the question of 1.1 first. See whose code is flexible, concise and clear. And then do 1.2.
(sweat. There is no need to think about Chinese.)
In fact, I also want to solicit a better way. It is estimated that if there is Chinese. Maybe you can redirect to the text and then judge the bytes. I guess so.
Finally: more than one problem, don't just use the method of redirecting the text.
523066680:
The code is as follows:
@ echo off
Echo,i like the bathome,because here is the batch of the world. > x.x
For / f "tokens=*"% an in ('dir x.x /-c ^ | find "bytes" ^ | find / v ":"') do (
For / f "tokens=3"% b in ('echo,%%a') do (
Set / a n=%%b-2
Call echo% n%%
Del x.x
)
)
Pause > nul
Shqf:
The code is as follows:
::% a%% roommates & ^ * ~ are you o k? ":\ / ``verfdxcweippo opj x ds gw!%%
@ echo off&setlocal enabledelayedexpansion
Set / p str=
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.