autoit基础 String 字符串处理

网友投稿 1791 2022-09-13

autoit基础 String 字符串处理

autoit基础 String 字符串处理

OS : Windows 10 Version 21H1       AutoIt : v3.3.16.0        blog : 师万物  typesetting : Markdown

script

Global $name = "lisa-john" ;转为字符串 ;String ( expression ) ;Returns the string representation of an expression. ConsoleWrite(String(10)) ConsoleWrite(IsString(String(10))) ConsoleWrite(@CRLF) ;字符串长度 ;StringLen ( "string" ) ;Returns the number of characters in a string. ConsoleWrite(StringLen($name)) ConsoleWrite(@CRLF) ;截取 ;StringMid ( "string", start [, count = -1] ) ;Extracts a number of characters from a string. ConsoleWrite(StringMid($name,3,2)) ConsoleWrite(@CRLF) ;左侧删除 ;StringTrimLeft ( "string", count ) ;Trims a number of characters from the left hand side of a string. ConsoleWrite(StringTrimLeft($name,2)) ConsoleWrite(@CRLF) ;字符串替换 ;StringReplace ( "string", "searchstring/start", "replacestring" [, occurrence = 0 [, casesense = 0]] ) ;Replaces substrings in a string. ConsoleWrite(StringReplace($name,'sa','li')) ConsoleWrite(@CRLF) ;字符串分割 ;StringSplit ( "string", "delimiters" [, flag = 0] ) ;Splits up a string into substrings depending on the given delimiters. Global $arr[] = StringSplit($name,'-') ConsoleWrite(UBound($arr)) For $i In $arr ConsoleWrite($i) Next ConsoleWrite(@CRLF) ;判断是否只有大写字符 ;StringIsUpper ( "string" ) ;Checks if a string contains only uppercase characters. ConsoleWrite(StringIsUpper($name)) ConsoleWrite(@CRLF)

Go

>"D:\Develop\AutoIt3\SciTE\..\AutoIt3.exe" /ErrorStdOut "E:\autoit\demo.au3" 101 9 sa sa-john lili-john 32lisajohn 0 >Exit code: 0

学习资源

autoit autoit-docs IT天空 msdn 51CTO社区

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:C#报Lc.exe已退出 代码为-1 错误解决方法(c罗)
下一篇:autoit基础 Send 通过运行启动记事本
相关文章

 发表评论

暂时没有评论,来抢沙发吧~