Jump to content

Search the Community

Showing results for tags 'strip'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • Forum FAQ
  • AutoIt

Calendars

  • Community Calendar

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 2 results

  1. I thought this function may be useful to some people. It works in almost the same way as the core AutoIt function StringStripWS. The difference is that you can specify any characters to be stripped. Note: The function is case sensitive ;======================================================================================================== ; ; Function Name: _StringStripChr($sString_In, $sChr, $iFlags = 2, $iCount = 0) ; Description: ; Parameters: ; $sString_In - The string to be stripped ; $sChr - The characters to be stripped (case sensitive) ; $iFlags - Flag to indicate the type of stripping that should be performed (add the flags together for multiple operations): ; 1 = strip leading instances of characters in $sChr ; 2 (Default) = strip trailing instances of characters in $sChr ; 4 = Replace multiple instances of characters in $sChr with a single instance ; 8 = strip all instances of $sChr (over-rides all other flags) ; $iCount - The max number of leading or trailing instances of $sChr to strip ; 0 (Default) = Strip all ; ; Requirement: None. ; Return Value: Stripped string ; Author: Bowmore ; ; Notes: ; ; Examples: ; _StringStripChr("AAAAbdcaefgA", "A", 3, 0) ; would return ; "bdcaefg" ; ; _StringStripChr("AAAAbdcaefgA", "A", 2, 0) ; would return ; "AAbdcaefg" ; ; _StringStripChr("ABCAAbdcaefgA", "AB", 7, 0) ; would return ; "CAbdcaefg" ; ; _StringStripChr("ABCAAbdcaefgA", "ABe", 8, 0) ; would return ; "Cbdcafg" ; ;======================================================================================================== Func _StringStripChr($sString_In, $sChr, $iFlags = 2, $iCount = 0) Local $sNewString = $sString_In Local $sChr1 = "" If (BitAND($iFlags, 8) = 8) Then For $i = 1 To StringLen($sChr) $sChr1 = StringMid($sChr, $i, 1) $sNewString = StringReplace($sNewString, $sChr1, "", 0, 1) Next Else If (BitAND($iFlags, 4) = 4) Then For $i = 1 To StringLen($sChr) $sChr1 = StringMid($sChr, $i, 1) $sNewString = StringRegExpReplace($sNewString, $sChr1 & "{2,}", $sChr1) Next EndIf If (BitAND($iFlags, 2) = 2) Then If $iCount = 0 Then While (StringInStr($sChr, StringRight($sNewString, 1), 1)) $sNewString = StringTrimRight($sNewString, 1) WEnd Else For $i = 1 To $iCount If (StringInStr($sChr, StringRight($sNewString, 1), 1)) Then $sNewString = StringTrimRight($sNewString, 1) Else ExitLoop EndIf Next EndIf EndIf If (BitAND($iFlags, 1) = 1) Then If $iCount = 0 Then While (StringInStr($sChr, StringLeft($sNewString, 1), 1)) $sNewString = StringTrimLeft($sNewString, 1) WEnd Else For $i = 1 To $iCount If (StringInStr($sChr, StringLeft($sNewString, 1), 1)) Then $sNewString = StringTrimLeft($sNewString, 1) Else ExitLoop EndIf Next EndIf EndIf EndIf Return $sNewString EndFunc ;==>_StringStripChr EDIT: Corrected name of function used in examples. Fixed option 4 to work as described. Fixed case sensitivity issue with options 1 and 2
  2. Function Reference _GuiImageListEx.au3 Functions that assist with ImageList control management with support a vertical image strip! Sintax: _GUIImageList_AddVerticalStrip( hWnd, hInstance, sImage[, iWidth = 0[, iHeight = 0[, iImgCount = -1 ]]] ) _GUIImageList_DrawVerticalStrip( hWnd, iIndex, hDC, iX, iY[, iStyle = 0 ] ) _GUIImageList_DrawVerticalStripEx( hWnd, iIndex, hDC, iX, iY[, iDX = 0[, iDY = 0[, iStyle = 0 ] ) _GUIImageList_DestroyEx( hWnd ) Supports: ; Bitmaps with vertical image strip! Downloads: Version: 0.12 _GuiImageListEx_(RedirectLink).html Note: Solve this old problem: Need the WinApiEx.au3: Usage example is included! Sample: Fixes: Regards, João Carlos.
×
×
  • Create New...