找回密码
 加入
搜索
楼主: lixiaolong

[AU3基础] [正则练习] 删除各行的重复字符

 火... [复制链接]
 楼主| 发表于 2011-12-13 18:43:18 | 显示全部楼层
回复 31# happytc

看不懂C。。。这个autoit也能实现吧?
发表于 2011-12-13 19:19:50 | 显示全部楼层
回复 32# lixiaolong


    呵,当然au3也能了,只是看起来没有c简洁效率高而已。
发表于 2011-12-13 22:22:51 | 显示全部楼层
回复 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

评分

参与人数 2金钱 +60 贡献 +7 收起 理由
lixiaolong + 30 + 5 这个效率好啊!学习了!!
afan + 30 + 2

查看全部评分

发表于 2011-12-14 12:14:13 | 显示全部楼层
特别来学习,谢谢~~~~~
发表于 2019-10-30 16:27:08 | 显示全部楼层
挖挖挖 谢谢正是需要的
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-11-16 06:54 , Processed in 0.074673 second(s), 17 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表