回复 30# lixiaolong
来个递归的,试试效率
Local $Str = _
'AutoIt v3 is a freeware BASIC-like scripting language designed for automating the Windows GUI and general scripting. It uses a combination of simulated keystrokes, mouse movement and window/control manipulation in order to automate tasks in a way not possible or reliable with other languages (e.g. VBScript and SendKeys). AutoIt is also very small, self-contained and will run on all versions of Windows out-of-the-box with no annoying "runtimes" required! ' & @CRLF & @CRLF & _
'AutoIt was initially designed for PC "roll out" situations to reliably automate and configure thousands of PCs. Over time it has become a powerful language that supports complex expressions, user functions, loops and everything else that veteran scripters would expect.' & @CRLF & _
'Features: ' & @CRLF & @CRLF & _
'Easy to learn BASIC-like syntax ' & @CRLF & _
'Simulate keystrokes and mouse movements ' & @CRLF & _
'Manipulate windows and processes ' & @CRLF & _
'Interact with all standard windows controls ' & @CRLF & _
'Scripts can be compiled into standalone executables ' & @CRLF & _
'Create Graphical User Interfaces (GUIs) ' & @CRLF & _
'COM support ' & @CRLF & _
'Regular expressions ' & @CRLF & _
'Directly call external DLL and Windows API functions ' & @CRLF & _
'Scriptable RunAs functions ' & @CRLF & _
'Detailed helpfile and large community-based support forums ' & @CRLF & _
'Compatible with Windows 95 / 98 / ME / NT4 / 2000 / XP / 2003 / Vista / 2008 ' & @CRLF & _
'Unicode and x64 support ' & @CRLF & _
'Digitally signed for peace of mind ' & @CRLF & _
"Works with Windows Vista's User Account Control (UAC) " & @CRLF & _
'AutoIt has been designed to be as small as possible and stand-alone with no external .dll files or registry entries required making it safe to use on Servers. Scripts can be compiled into stand-alone executables with Aut2Exe.' & @CRLF & @CRLF & _
'Also supplied is a combined COM and DLL version of AutoIt called AutoItX that allows you to add the unique features of AutoIt to your own favourite scripting or programming languages!' & @CRLF & @CRLF & _
'Best of all, AutoIt continues to be FREE - but if you want to support the time, money and effort spent on the project and web hosting then you may donate at the AutoIt homepage.' & @CRLF & @CRLF & _
' ' & @CRLF & @CRLF
Local $ts = TimerInit()
MsgBox(0, TimerDiff($ts), "区分大小写"&@CRLF&No_1($Str,1))
Local $ts = TimerInit()
MsgBox(0, TimerDiff($ts), "不区分大小写"&@CRLF&No_1($Str))
Func No_1($num__1,$flag=0);flag=0 不区分大小写,flag=1区分大小写
Local $head=StringLeft($num__1,1)
If StringInStr(StringTrimLeft($num__1,1),$head,$flag)>0 then
$out=StringReplace($num__1,StringLeft($num__1,1),'',0,$flag)
Return No_1($out,$flag)
EndIf
Return $head
EndFunc ;==>No_1
|