<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.autoitscript.com/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Trong</id>
	<title>AutoIt Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://www.autoitscript.com/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Trong"/>
	<link rel="alternate" type="text/html" href="https://www.autoitscript.com/wiki/Special:Contributions/Trong"/>
	<updated>2026-05-05T22:40:35Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.6</generator>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Forums&amp;diff=13290</id>
		<title>Forums</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Forums&amp;diff=13290"/>
		<updated>2016-01-07T17:19:57Z</updated>

		<summary type="html">&lt;p&gt;Trong: /* Unofficial Forums */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In order to receive support and share your own scripts you may sign up for one or more of the forums.&lt;br /&gt;
&lt;br /&gt;
= Official Forums =&lt;br /&gt;
&lt;br /&gt;
The official forum is a very good place to get help and share scripts. &lt;br /&gt;
It has a lot of members and is often praised for its quick and professional help and support. &lt;br /&gt;
One of the advantages of AutoIt over other, more global, languages - is the concentrated community.&lt;br /&gt;
There you are posting alongside the developers of the code, so chances are they know what they&#039;re talking about!&lt;br /&gt;
&lt;br /&gt;
[http://www.autoitscript.com/forum/index.php AutoIt Forums]&lt;br /&gt;
&lt;br /&gt;
== Searching the Forums ==&lt;br /&gt;
&lt;br /&gt;
The AutoIt forum allows for users to form powerful search queries which is a boon to any AutoIt user.  &lt;br /&gt;
If the answer to a question is not found in the [[Documentation|help file]] then a search of the forum is in order.&lt;br /&gt;
Before you post a question it is always better to search the forums first to see if your question has been answered before.&lt;br /&gt;
There are two common ways to search the forum:&lt;br /&gt;
&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?act=Search AutoItScript Forum Search]&lt;br /&gt;
&lt;br /&gt;
* [http://www.google.com Google]&lt;br /&gt;
&lt;br /&gt;
The [http://www.autoitscript.com/forum/index.php?autocom=downloads file downloads] section of the site can also be searched.&lt;br /&gt;
&lt;br /&gt;
=== Using Google ===&lt;br /&gt;
&lt;br /&gt;
The forum search engine is very powerful, but if you find that you need more power you could try [http://www.google.com Google]&lt;br /&gt;
Google cannot be used to search the Chat forum.&lt;br /&gt;
&lt;br /&gt;
Enter into Google: &lt;br /&gt;
&lt;br /&gt;
 site:www.autoitscript.com/forum/ your search query.&lt;br /&gt;
&lt;br /&gt;
If you are an advanced user then try: &lt;br /&gt;
&lt;br /&gt;
 (site:*.autoitscript.com | site:msdn.microsoft.com) tutorial howto&lt;br /&gt;
&lt;br /&gt;
Note: Spaces around | is important.&lt;br /&gt;
&lt;br /&gt;
And finally a slightly different search:&lt;br /&gt;
&lt;br /&gt;
 filetype:pdf autoit&lt;br /&gt;
&lt;br /&gt;
== Code of Conduct ==&lt;br /&gt;
&lt;br /&gt;
Before you post a question or start a new script, it is always better to search the forums first to see if your question has been answered before or to see if you can find a similar script shared by someone else.&lt;br /&gt;
Please think about asking &#039;&#039;&#039;the right question&#039;&#039;&#039; and asking &#039;&#039;&#039;the question right!&#039;&#039;&#039;&lt;br /&gt;
Do not make posts discussing the automation of games in any manner for any reason.  &lt;br /&gt;
They will not be answered.  Persistence will most likely result in a swift and permanent ban.&lt;br /&gt;
&lt;br /&gt;
These are must read topics before posting anything:&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=54168 Chat Forum Rules]&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=14632 Keylogger Rules]&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=65889 Asking for Source Code]&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=37289 FAQ1] &lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=23822 FAQ2]&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=34658 Are my AutoIt EXEs Really Infected?]&lt;br /&gt;
&lt;br /&gt;
== Unofficial Forums ==&lt;br /&gt;
&lt;br /&gt;
These are some of the other unofficial forums which are often in languages other than English.&lt;br /&gt;
&lt;br /&gt;
* French: http://www.autoit.fr/&lt;br /&gt;
* German: http://www.autoit.de/&lt;br /&gt;
* Portuguese: http://forum.autoitbrasil.com/&lt;br /&gt;
* Spanish: http://www.emesn.com/autoitforum/&lt;br /&gt;
* Spanish: http://autoitespa.espanaforo.com/&lt;br /&gt;
* Chinese: http://autoitx.com/&lt;br /&gt;
* Vietnam: http://www.autoitvn.com/&lt;br /&gt;
&lt;br /&gt;
== Useful links ==&lt;br /&gt;
&lt;br /&gt;
* [http://www.autoitscript.com/forum/index.php?showtopic=94713 General Tips for Using AutoIt] - Some tips that a lot of people will find useful.&lt;br /&gt;
* [https://www.autoitscript.com/forum/topic/169097-forum-rules Forum rules] - Read this if you are new to the forum.&lt;/div&gt;</summary>
		<author><name>Trong</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Snippets_(_AutoIt_String_)&amp;diff=13289</id>
		<title>Snippets ( AutoIt String )</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Snippets_(_AutoIt_String_)&amp;diff=13289"/>
		<updated>2016-01-07T17:11:11Z</updated>

		<summary type="html">&lt;p&gt;Trong: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
[[category:Snippets]]&lt;br /&gt;
&lt;br /&gt;
{{Snippet Credit Header}}&lt;br /&gt;
&lt;br /&gt;
== _StringEqualSplit ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
| AuthorURL = 15769-czardas&lt;br /&gt;
| AuthorName = czardas&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;Array.au3&amp;gt;&lt;br /&gt;
Local $aArray = _StringEqualSplit(&amp;quot;12345678910&amp;quot;, 3)&lt;br /&gt;
_ArrayDisplay($aArray)&lt;br /&gt;
&lt;br /&gt;
Func _StringEqualSplit($sString, $iNumChars)&lt;br /&gt;
    If Not IsString($sString) Or $sString = &amp;quot;&amp;quot; Then Return SetError(1, 0, 0)&lt;br /&gt;
    If Not IsInt($iNumChars) Or $iNumChars &amp;lt; 1 Then Return SetError(2, 0, 0)&lt;br /&gt;
    Return StringRegExp($sString, &amp;quot;(?s).{1,&amp;quot; &amp;amp; $iNumChars &amp;amp; &amp;quot;}&amp;quot;, 3)&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | Return To Contents]]&lt;br /&gt;
&lt;br /&gt;
== _StringGetChrCount ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
| AuthorURL = 52-geosoft&lt;br /&gt;
| AuthorName = GEOSoft&lt;br /&gt;
| Desc = Check how many times the word &#039;test&#039; appears in the string. 1 = Case-sensitive or 0 = Non Case-sensitive.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; Check how many times the word &#039;test&#039; appears in the string. 1 = Case-sensitive or 0 = Non Case-sensitive.&lt;br /&gt;
ConsoleWrite(_StringGetChrCount(&amp;quot;test teste test&amp;quot;, &amp;quot;TEST&amp;quot;, 0) &amp;amp; @CRLF)&lt;br /&gt;
&lt;br /&gt;
Func _StringGetChrCount($sStr, $sChr, $iCase = 0)&lt;br /&gt;
	If $iCase &amp;lt;&amp;gt; 0 Then&lt;br /&gt;
		$iCase = 1&lt;br /&gt;
	EndIf&lt;br /&gt;
	StringReplace($sStr, $sChr, $sChr, 0, $iCase)&lt;br /&gt;
	Return @extended&lt;br /&gt;
EndFunc   ;==&amp;gt;_StringGetChrCount&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | Return To Contents]]&lt;br /&gt;
&lt;br /&gt;
== _StringEqualSplit ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
| AuthorURL = 15769-czardas&lt;br /&gt;
| AuthorName = czardas&lt;br /&gt;
| ModifierURL = 35302-guinness&lt;br /&gt;
| ModifierName = guinness&lt;br /&gt;
| Desc = Splits a string into an equal number of characters. The 0th index returns the number of items.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;Array.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;String.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Local $aSplitEqual = _StringEqualSplit(&#039;abcdefghijklmnopqrstuvwxyz&#039;, 5)&lt;br /&gt;
_ArrayDisplay($aSplitEqual)&lt;br /&gt;
&lt;br /&gt;
; By czardas &amp;amp; modified by guinness &amp;gt;&amp;gt; http://www.autoitscript.com/forum/topic/139260-autoit-snippets/page__st__20#entry992149&lt;br /&gt;
; Version: 1.10. AutoIt: V3.3.8.1&lt;br /&gt;
; Splits a string into an equal number of characters. The 0th index returns the number of items.&lt;br /&gt;
Func _StringEqualSplit($sString, $iNumChars)&lt;br /&gt;
	If IsString($sString) = 0 Or $sString == &#039;&#039; Then&lt;br /&gt;
		Return SetError(1, 0, 0)&lt;br /&gt;
	EndIf&lt;br /&gt;
&lt;br /&gt;
	If IsInt($iNumChars) = 0 Or $iNumChars &amp;lt; 1 Then&lt;br /&gt;
		Return SetError(2, 0, 0)&lt;br /&gt;
	EndIf&lt;br /&gt;
&lt;br /&gt;
	Local $aReturn = StringRegExp(_StringRepeat(&#039;0&#039;, 5) &amp;amp; $sString, &#039;(?s).{1,&#039; &amp;amp; $iNumChars &amp;amp; &#039;}&#039;, 3)&lt;br /&gt;
	$aReturn[0] = UBound($aReturn, 1) - 1&lt;br /&gt;
	Return $aReturn&lt;br /&gt;
EndFunc   ;==&amp;gt;_StringEqualSplit&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | Return To Contents]]&lt;br /&gt;
&lt;br /&gt;
== _StringIsNum ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
| AuthorURL = 38301-smartee&lt;br /&gt;
| AuthorName = smartee&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
ConsoleWrite(StringIsNum(&#039;Example&#039;) &amp;amp; @CRLF)&lt;br /&gt;
ConsoleWrite(StringIsNum(&#039;123456&#039;) &amp;amp; @CRLF)&lt;br /&gt;
ConsoleWrite(StringIsNum(&#039;Example &amp;amp; 123456&#039;) &amp;amp; @CRLF)&lt;br /&gt;
&lt;br /&gt;
Func StringIsNum($sString)&lt;br /&gt;
    Return StringRegExp($sString, &amp;quot;^([0-9]*(\.[0-9]+){1}|[0-9]+(\.[0-9]*){0,1})$&amp;quot;) = 1&lt;br /&gt;
EndFunc   ;==&amp;gt;StringIsNum&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | Return To Contents]]&lt;br /&gt;
&lt;br /&gt;
== _StringRemoveLine ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
| AuthorURL = 4813-smoke-n&lt;br /&gt;
| AuthorName = SmOke_N&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Global $string = &#039;This is an example&#039; &amp;amp; @CRLF &amp;amp; &#039;Of deleting a line&#039; &amp;amp; @CRLF &amp;amp; &#039;If you know at least the beginning text of the line.&#039;&lt;br /&gt;
&lt;br /&gt;
MsgBox(0, &#039;Original&#039;, $string)&lt;br /&gt;
&lt;br /&gt;
Global $deleteline = _StringRemoveLine($string, &#039;Of deleting&#039;)&lt;br /&gt;
&lt;br /&gt;
MsgBox(0, &#039;Deleted Line&#039;, $deleteline)&lt;br /&gt;
&lt;br /&gt;
Func _StringRemoveLine($hFile, $sDelete)&lt;br /&gt;
    If FileExists($hFile) Then $hFile = FileRead($hFile);Remove If FileExists($hFile) Then &amp;lt;&amp;lt; only&lt;br /&gt;
    Local $nSNS = StringInStr($hFile, @CRLF &amp;amp; $sDelete) - 1&lt;br /&gt;
    Local $sSFH = StringLeft($hFile, $nSNS)&lt;br /&gt;
    Local $sRL = StringTrimLeft($hFile, StringLen($sSFH) + 2)&lt;br /&gt;
    Local $sLLEN = StringLen(StringLeft($sRL, StringInStr($sRL, @CRLF)))&lt;br /&gt;
    If Not $sLLEN Then $sLLEN = StringLen($sRL)&lt;br /&gt;
    Return $sSFH &amp;amp; StringTrimLeft($hFile, $sLLEN + $nSNS + 2)&lt;br /&gt;
EndFunc ;==&amp;gt;_StringRemoveLine()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | Return To Contents]]&lt;br /&gt;
&lt;br /&gt;
== _StringReplaceBlank ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
| AuthorURL = 4813-smoke-n&lt;br /&gt;
| AuthorName = SmOke_N&lt;br /&gt;
| Desc = Remove blank lines from a File&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; Remove blank lines from a File&lt;br /&gt;
Local $sString = &amp;quot;I am a string&amp;quot; &amp;amp; @CRLF &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
		&amp;quot;With Empty Lines&amp;quot; &amp;amp; @CRLF &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
		&amp;quot;Please Remove those empty lines&amp;quot;&lt;br /&gt;
&lt;br /&gt;
MsgBox(4096, &amp;quot;Before&amp;quot;, $sString)&lt;br /&gt;
&lt;br /&gt;
$sString = _StringReplaceBlank($sString, 1)&lt;br /&gt;
&lt;br /&gt;
MsgBox(4096, &amp;quot;Replaced: &amp;quot; &amp;amp; @extended &amp;amp; &amp;quot; lines.&amp;quot;, $sString)&lt;br /&gt;
&lt;br /&gt;
Func _StringReplaceBlank($sString, $sSpaces = &amp;quot;&amp;quot;)&lt;br /&gt;
	If $sSpaces Then&lt;br /&gt;
		$sSpaces = &amp;quot;\s*&amp;quot;&lt;br /&gt;
	EndIf&lt;br /&gt;
&lt;br /&gt;
	$sString = StringRegExpReplace($sString, &amp;quot;(?s)\r\n&amp;quot; &amp;amp; $sSpaces &amp;amp; &amp;quot;\r\n&amp;quot;, @CRLF)&lt;br /&gt;
&lt;br /&gt;
	If @extended Then&lt;br /&gt;
		Return SetError(0, @extended, $sString)&lt;br /&gt;
	EndIf&lt;br /&gt;
&lt;br /&gt;
	Return SetError(1, 0, $sString)&lt;br /&gt;
EndFunc   ;==&amp;gt;_StringReplaceBlank&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | Return To Contents]]&lt;br /&gt;
&lt;br /&gt;
== _StringTrimLeftIsEqual ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
| AuthorURL = 35302-guinness&lt;br /&gt;
| AuthorName = guinness&lt;br /&gt;
| Desc = Strip a character/word from the leftmost part of a string.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
ConsoleWrite(_StringTrimLeftIsEqual(&#039;C:\Test&#039;, &#039;C:\&#039;) &amp;amp; @CRLF) ; Returns Test as the string &#039;C:\&#039; is stripped from the left.&lt;br /&gt;
ConsoleWrite(_StringTrimLeftIsEqual(&#039;C:\Test\&#039;, &#039;C&#039;) &amp;amp; @CRLF) ; Returns :\Test as the character &#039;C&#039; is stripped from the left.&lt;br /&gt;
ConsoleWrite(_StringTrimLeftIsEqual(&#039;C:\Test\&#039;, &#039;Test&#039;) &amp;amp; @CRLF) ; Returns the initial string as the string &#039;Test&#039; was not found to the leftmost part of the string.&lt;br /&gt;
&lt;br /&gt;
; Version: 1.00. AutoIt: V3.3.8.1&lt;br /&gt;
; Strip a character/word from the leftmost part of a string.&lt;br /&gt;
Func _StringTrimLeftIsEqual($sString, $sStringTrim)&lt;br /&gt;
    Local $aStringTrim[2] = [0, StringLen($sStringTrim)]&lt;br /&gt;
    Return StringTrimLeft($sString, $aStringTrim[Number(StringLeft($sString, $aStringTrim[1]) == $sStringTrim)])&lt;br /&gt;
EndFunc   ;==&amp;gt;_StringTrimLeftIsEqual&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | Return To Contents]]&lt;br /&gt;
&lt;br /&gt;
== _StringTrimRightIsEqual ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
| AuthorURL = 35302-guinness&lt;br /&gt;
| AuthorName = guinness&lt;br /&gt;
| Desc = Strip a character/word from the rightmost part of a string.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
ConsoleWrite(_StringTrimRightIsEqual(&#039;C:\Test&#039;, &#039;Test&#039;) &amp;amp; @CRLF) ; Returns C:\ as the string &#039;Test&#039; is stripped from the right.&lt;br /&gt;
ConsoleWrite(_StringTrimRightIsEqual(&#039;C:\Test\&#039;, &#039;\&#039;) &amp;amp; @CRLF) ; Returns C:\Test as the character &#039;\&#039; is stripped from the right.&lt;br /&gt;
ConsoleWrite(_StringTrimRightIsEqual(&#039;C:\Test\&#039;, &#039;Test&#039;) &amp;amp; @CRLF) ; Returns the initial string as the string &#039;Test&#039; was not found to the rightmost part of the string.&lt;br /&gt;
&lt;br /&gt;
; Version: 1.00. AutoIt: V3.3.8.1&lt;br /&gt;
; Strip a character/word from the rightmost part of a string.&lt;br /&gt;
Func _StringTrimRightIsEqual($sString, $sStringTrim)&lt;br /&gt;
    Local $aStringTrim[2] = [0, StringLen($sStringTrim)]&lt;br /&gt;
    Return StringTrimRight($sString, $aStringTrim[Number(StringRight($sString, $aStringTrim[1]) == $sStringTrim)])&lt;br /&gt;
EndFunc   ;==&amp;gt;_StringTrimRightIsEqual&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | Return To Contents]]&lt;br /&gt;
&lt;br /&gt;
== StringTrimLeftUntil ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
| AuthorURL = 89462-TheDcoder&lt;br /&gt;
| AuthorName = TheDcoder&lt;br /&gt;
| Desc = Trim a string left until it reaches the delimiter character.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; #FUNCTION# ====================================================================================================================&lt;br /&gt;
; Name ..........: StringTrimLeftUntil&lt;br /&gt;
; Description ...: Trim a string left until it reaches the delimiter charecter&lt;br /&gt;
; Syntax ........: StringTrimLeftUntil($sDelimiter, $sString)&lt;br /&gt;
; Parameters ....: $sDelimiter          - Charecter(s) to trim until&lt;br /&gt;
;                  $sString             - A string value.&lt;br /&gt;
;                  $iOccurrence         - Trim until which occurrence of the delimiter [Default = 1st occurrence]&lt;br /&gt;
; Return values .: Trimmed String&lt;br /&gt;
; Author ........: TheDcoder&lt;br /&gt;
; Modified ......: Thanks to water for the Idea &lt;br /&gt;
; Remarks .......: This function is not case sensitive meaning &amp;quot;DeLiMiTeR&amp;quot; is same as &amp;quot;Delimiter&amp;quot;&lt;br /&gt;
; Related .......: StringTrimLeft&lt;br /&gt;
; Link ..........: https://www.autoitscript.com/forum/topic/139260-autoit-snippets/?do=findComment&amp;amp;comment=1250764&lt;br /&gt;
; Example .......: No&lt;br /&gt;
; ===============================================================================================================================&lt;br /&gt;
Func StringTrimLeftUntil($sDelimiter, $sString, $iOccurrence = 1)&lt;br /&gt;
	$iDelimiterLen = StringLen($sDelimiter)&lt;br /&gt;
    $sString = StringTrimLeft($sString, StringInStr($sString, $sDelimiter, 2, $iOccurrence) + ($iDelimiterLen - 1)) ; This is a little hard to explain:&lt;br /&gt;
	#cs =========================================================================================================================================|&lt;br /&gt;
	| What it does is:                                                                                                                           |&lt;br /&gt;
	| 1. Find the delimiter&#039;s position in the string (StringInStr)                                                                               |&lt;br /&gt;
	| 2. Add delimiter&#039;s Length to delimiters position (I remove 1 for delimiter&#039;s length because StringInStr already contains that 1 charecter) |&lt;br /&gt;
	| 3. Trim the string :)                                                                                                                      |&lt;br /&gt;
	#ce =========================================================================================================================================|&lt;br /&gt;
    Return $sString ; Return the String :D&lt;br /&gt;
EndFunc   ;==&amp;gt;StringTrimLeftUntil&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | Return To Contents]]&lt;br /&gt;
&lt;br /&gt;
== StringTrimRightUntil ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
| AuthorURL = 89462-TheDcoder&lt;br /&gt;
| AuthorName = TheDcoder&lt;br /&gt;
| Desc = Trim a string right until it reaches the delimiter character.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; #FUNCTION# ====================================================================================================================&lt;br /&gt;
; Name ..........: StringTrimRightUntil&lt;br /&gt;
; Description ...: Trim a string right until it reaches the delimiter charecter&lt;br /&gt;
; Syntax ........: StringTrimRightUntil($sDelimiter, $sString)&lt;br /&gt;
; Parameters ....: $sDelimiter          - Charecter(s) to trim until&lt;br /&gt;
;                  $sString             - A string value.&lt;br /&gt;
;                  $iOccurrence         - Trim until which occurrence of the delimiter [Default = 1st occurrence]&lt;br /&gt;
; Return values .: Trimmed String&lt;br /&gt;
; Author ........: TheDcoder&lt;br /&gt;
; Modified ......: Me&lt;br /&gt;
; Remarks .......: This function is not case sensitive meaning &amp;quot;DeLiMiTeR&amp;quot; is same as &amp;quot;Delimiter&amp;quot;&lt;br /&gt;
; Related .......: StringTrimRight&lt;br /&gt;
; Link ..........: https://www.autoitscript.com/forum/topic/139260-autoit-snippets/?do=findComment&amp;amp;comment=1250764&lt;br /&gt;
; Example .......: No&lt;br /&gt;
; ===============================================================================================================================&lt;br /&gt;
Func StringTrimRightUntil($sDelimiter, $sString, $iOccurrence = 1)&lt;br /&gt;
	$iStringLen = StringLen($sString) ; We need string&#039;s len&lt;br /&gt;
	$iDelimiterLen = StringLen($sDelimiter) ; We need delimiter&#039;s len too&lt;br /&gt;
    $sString = StringTrimRight($sString, ($iStringLen - StringInStr($sString, $sDelimiter, 2, $iOccurrence)) + $iDelimiterLen) ; Explanation:&lt;br /&gt;
	#cs ============================================================================================|&lt;br /&gt;
	| 1. Find delimiters postition                                                                  |&lt;br /&gt;
	| 2. Remove String&#039;s len from delimiters position to invert the trimming process (to the right) |&lt;br /&gt;
	| 3. Add the delimiter&#039;s len to trim the delimiter                                              |&lt;br /&gt;
	| 4. Trim the string!!!                                                                         |&lt;br /&gt;
	#ce ============================================================================================|&lt;br /&gt;
    Return $sString ; Return the String &lt;br /&gt;
EndFunc   ;==&amp;gt;StringTrimRightUntil&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== StringBetween ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
| AuthorURL = 77301-trong&lt;br /&gt;
| AuthorName = Trong&lt;br /&gt;
| Desc = Find strings between two string delimiters.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; EG---------------------------------------------- -&lt;br /&gt;
Local $sString = StringBetween(&amp;quot;&amp;lt;test&amp;gt;C&amp;lt;/test&amp;gt;&amp;lt;test&amp;gt;B&amp;lt;/test&amp;gt;&amp;lt;test&amp;gt;A&amp;lt;/test&amp;gt;&amp;quot;, &amp;quot;&amp;lt;test&amp;gt;&amp;quot;, &amp;quot;&amp;lt;/test&amp;gt;&amp;quot;)&lt;br /&gt;
MsgBox(0, &amp;quot;StringBetween&amp;quot;, &amp;quot;Strings between &amp;lt;test&amp;gt; and &amp;lt;/test&amp;gt;&amp;quot; &amp;amp; @CRLF &amp;amp; &amp;quot;Is: &amp;quot; &amp;amp; $sString &amp;amp; @CRLF &amp;amp; &amp;quot;In text: &amp;lt;test&amp;gt;C&amp;lt;/test&amp;gt;&amp;lt;test&amp;gt;B&amp;lt;/test&amp;gt;&amp;lt;test&amp;gt;A&amp;lt;/test&amp;gt;&amp;quot;)&lt;br /&gt;
; ------------------------------------------------ -&lt;br /&gt;
&lt;br /&gt;
; #FUNCTION# ====================================================================================================================&lt;br /&gt;
; Name ..........: StringBetween&lt;br /&gt;
; Description ...: Find strings between two string delimiters&lt;br /&gt;
; Syntax ........: StringBetween($sString, $sStart, $sEnd)&lt;br /&gt;
; Parameters ....: $sString         - The string to search.&lt;br /&gt;
; Parameters ....: $sStart          - The beginning of the string to find.&lt;br /&gt;
;                  $sEnd            - The end of the string to find.&lt;br /&gt;
; Return values .: Success: a found string&lt;br /&gt;
;                  Failure: sets the @error flag to non-zero.&lt;br /&gt;
;                  @error: 1 - No strings found.&lt;br /&gt;
; Author ........: Trong&lt;br /&gt;
; Related .......: _StringBetween&lt;br /&gt;
; Link ..........: https://www.autoitscript.com/forum/topic/139260-autoit-snippets/?do=findComment&amp;amp;comment=1290019&lt;br /&gt;
; Example .......: Yes&lt;br /&gt;
; ===============================================================================================================================&lt;br /&gt;
&lt;br /&gt;
Func StringBetween($sString, $sStart, $sEnd)&lt;br /&gt;
	$sString = StringReverse(StringTrimLeft($sString, StringInStr($sString, $sStart) + StringLen($sStart) - 1))&lt;br /&gt;
	$sString = StringReverse(StringTrimLeft($sString, StringInStr($sString, StringReverse($sEnd)) + StringLen($sEnd) - 1))&lt;br /&gt;
	Return SetError(StringLen($sString) &amp;lt; 1, 0, $sString)&lt;br /&gt;
EndFunc   ;==&amp;gt;StringBetween&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[#top | Return To Contents]]&lt;/div&gt;</summary>
		<author><name>Trong</name></author>
	</entry>
	<entry>
		<id>https://www.autoitscript.com/w/index.php?title=Snippets_(_AutoIt_String_)&amp;diff=13288</id>
		<title>Snippets ( AutoIt String )</title>
		<link rel="alternate" type="text/html" href="https://www.autoitscript.com/w/index.php?title=Snippets_(_AutoIt_String_)&amp;diff=13288"/>
		<updated>2016-01-07T17:03:54Z</updated>

		<summary type="html">&lt;p&gt;Trong: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
[[category:Snippets]]&lt;br /&gt;
&lt;br /&gt;
{{Snippet Credit Header}}&lt;br /&gt;
&lt;br /&gt;
== _StringEqualSplit ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
| AuthorURL = 15769-czardas&lt;br /&gt;
| AuthorName = czardas&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;Array.au3&amp;gt;&lt;br /&gt;
Local $aArray = _StringEqualSplit(&amp;quot;12345678910&amp;quot;, 3)&lt;br /&gt;
_ArrayDisplay($aArray)&lt;br /&gt;
&lt;br /&gt;
Func _StringEqualSplit($sString, $iNumChars)&lt;br /&gt;
    If Not IsString($sString) Or $sString = &amp;quot;&amp;quot; Then Return SetError(1, 0, 0)&lt;br /&gt;
    If Not IsInt($iNumChars) Or $iNumChars &amp;lt; 1 Then Return SetError(2, 0, 0)&lt;br /&gt;
    Return StringRegExp($sString, &amp;quot;(?s).{1,&amp;quot; &amp;amp; $iNumChars &amp;amp; &amp;quot;}&amp;quot;, 3)&lt;br /&gt;
EndFunc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | Return To Contents]]&lt;br /&gt;
&lt;br /&gt;
== _StringGetChrCount ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
| AuthorURL = 52-geosoft&lt;br /&gt;
| AuthorName = GEOSoft&lt;br /&gt;
| Desc = Check how many times the word &#039;test&#039; appears in the string. 1 = Case-sensitive or 0 = Non Case-sensitive.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; Check how many times the word &#039;test&#039; appears in the string. 1 = Case-sensitive or 0 = Non Case-sensitive.&lt;br /&gt;
ConsoleWrite(_StringGetChrCount(&amp;quot;test teste test&amp;quot;, &amp;quot;TEST&amp;quot;, 0) &amp;amp; @CRLF)&lt;br /&gt;
&lt;br /&gt;
Func _StringGetChrCount($sStr, $sChr, $iCase = 0)&lt;br /&gt;
	If $iCase &amp;lt;&amp;gt; 0 Then&lt;br /&gt;
		$iCase = 1&lt;br /&gt;
	EndIf&lt;br /&gt;
	StringReplace($sStr, $sChr, $sChr, 0, $iCase)&lt;br /&gt;
	Return @extended&lt;br /&gt;
EndFunc   ;==&amp;gt;_StringGetChrCount&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | Return To Contents]]&lt;br /&gt;
&lt;br /&gt;
== _StringEqualSplit ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
| AuthorURL = 15769-czardas&lt;br /&gt;
| AuthorName = czardas&lt;br /&gt;
| ModifierURL = 35302-guinness&lt;br /&gt;
| ModifierName = guinness&lt;br /&gt;
| Desc = Splits a string into an equal number of characters. The 0th index returns the number of items.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;#include &amp;lt;Array.au3&amp;gt;&lt;br /&gt;
#include &amp;lt;String.au3&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Local $aSplitEqual = _StringEqualSplit(&#039;abcdefghijklmnopqrstuvwxyz&#039;, 5)&lt;br /&gt;
_ArrayDisplay($aSplitEqual)&lt;br /&gt;
&lt;br /&gt;
; By czardas &amp;amp; modified by guinness &amp;gt;&amp;gt; http://www.autoitscript.com/forum/topic/139260-autoit-snippets/page__st__20#entry992149&lt;br /&gt;
; Version: 1.10. AutoIt: V3.3.8.1&lt;br /&gt;
; Splits a string into an equal number of characters. The 0th index returns the number of items.&lt;br /&gt;
Func _StringEqualSplit($sString, $iNumChars)&lt;br /&gt;
	If IsString($sString) = 0 Or $sString == &#039;&#039; Then&lt;br /&gt;
		Return SetError(1, 0, 0)&lt;br /&gt;
	EndIf&lt;br /&gt;
&lt;br /&gt;
	If IsInt($iNumChars) = 0 Or $iNumChars &amp;lt; 1 Then&lt;br /&gt;
		Return SetError(2, 0, 0)&lt;br /&gt;
	EndIf&lt;br /&gt;
&lt;br /&gt;
	Local $aReturn = StringRegExp(_StringRepeat(&#039;0&#039;, 5) &amp;amp; $sString, &#039;(?s).{1,&#039; &amp;amp; $iNumChars &amp;amp; &#039;}&#039;, 3)&lt;br /&gt;
	$aReturn[0] = UBound($aReturn, 1) - 1&lt;br /&gt;
	Return $aReturn&lt;br /&gt;
EndFunc   ;==&amp;gt;_StringEqualSplit&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | Return To Contents]]&lt;br /&gt;
&lt;br /&gt;
== _StringIsNum ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
| AuthorURL = 38301-smartee&lt;br /&gt;
| AuthorName = smartee&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
ConsoleWrite(StringIsNum(&#039;Example&#039;) &amp;amp; @CRLF)&lt;br /&gt;
ConsoleWrite(StringIsNum(&#039;123456&#039;) &amp;amp; @CRLF)&lt;br /&gt;
ConsoleWrite(StringIsNum(&#039;Example &amp;amp; 123456&#039;) &amp;amp; @CRLF)&lt;br /&gt;
&lt;br /&gt;
Func StringIsNum($sString)&lt;br /&gt;
    Return StringRegExp($sString, &amp;quot;^([0-9]*(\.[0-9]+){1}|[0-9]+(\.[0-9]*){0,1})$&amp;quot;) = 1&lt;br /&gt;
EndFunc   ;==&amp;gt;StringIsNum&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | Return To Contents]]&lt;br /&gt;
&lt;br /&gt;
== _StringRemoveLine ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
| AuthorURL = 4813-smoke-n&lt;br /&gt;
| AuthorName = SmOke_N&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
Global $string = &#039;This is an example&#039; &amp;amp; @CRLF &amp;amp; &#039;Of deleting a line&#039; &amp;amp; @CRLF &amp;amp; &#039;If you know at least the beginning text of the line.&#039;&lt;br /&gt;
&lt;br /&gt;
MsgBox(0, &#039;Original&#039;, $string)&lt;br /&gt;
&lt;br /&gt;
Global $deleteline = _StringRemoveLine($string, &#039;Of deleting&#039;)&lt;br /&gt;
&lt;br /&gt;
MsgBox(0, &#039;Deleted Line&#039;, $deleteline)&lt;br /&gt;
&lt;br /&gt;
Func _StringRemoveLine($hFile, $sDelete)&lt;br /&gt;
    If FileExists($hFile) Then $hFile = FileRead($hFile);Remove If FileExists($hFile) Then &amp;lt;&amp;lt; only&lt;br /&gt;
    Local $nSNS = StringInStr($hFile, @CRLF &amp;amp; $sDelete) - 1&lt;br /&gt;
    Local $sSFH = StringLeft($hFile, $nSNS)&lt;br /&gt;
    Local $sRL = StringTrimLeft($hFile, StringLen($sSFH) + 2)&lt;br /&gt;
    Local $sLLEN = StringLen(StringLeft($sRL, StringInStr($sRL, @CRLF)))&lt;br /&gt;
    If Not $sLLEN Then $sLLEN = StringLen($sRL)&lt;br /&gt;
    Return $sSFH &amp;amp; StringTrimLeft($hFile, $sLLEN + $nSNS + 2)&lt;br /&gt;
EndFunc ;==&amp;gt;_StringRemoveLine()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | Return To Contents]]&lt;br /&gt;
&lt;br /&gt;
== _StringReplaceBlank ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
| AuthorURL = 4813-smoke-n&lt;br /&gt;
| AuthorName = SmOke_N&lt;br /&gt;
| Desc = Remove blank lines from a File&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; Remove blank lines from a File&lt;br /&gt;
Local $sString = &amp;quot;I am a string&amp;quot; &amp;amp; @CRLF &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
		&amp;quot;With Empty Lines&amp;quot; &amp;amp; @CRLF &amp;amp; @CRLF &amp;amp; _&lt;br /&gt;
		&amp;quot;Please Remove those empty lines&amp;quot;&lt;br /&gt;
&lt;br /&gt;
MsgBox(4096, &amp;quot;Before&amp;quot;, $sString)&lt;br /&gt;
&lt;br /&gt;
$sString = _StringReplaceBlank($sString, 1)&lt;br /&gt;
&lt;br /&gt;
MsgBox(4096, &amp;quot;Replaced: &amp;quot; &amp;amp; @extended &amp;amp; &amp;quot; lines.&amp;quot;, $sString)&lt;br /&gt;
&lt;br /&gt;
Func _StringReplaceBlank($sString, $sSpaces = &amp;quot;&amp;quot;)&lt;br /&gt;
	If $sSpaces Then&lt;br /&gt;
		$sSpaces = &amp;quot;\s*&amp;quot;&lt;br /&gt;
	EndIf&lt;br /&gt;
&lt;br /&gt;
	$sString = StringRegExpReplace($sString, &amp;quot;(?s)\r\n&amp;quot; &amp;amp; $sSpaces &amp;amp; &amp;quot;\r\n&amp;quot;, @CRLF)&lt;br /&gt;
&lt;br /&gt;
	If @extended Then&lt;br /&gt;
		Return SetError(0, @extended, $sString)&lt;br /&gt;
	EndIf&lt;br /&gt;
&lt;br /&gt;
	Return SetError(1, 0, $sString)&lt;br /&gt;
EndFunc   ;==&amp;gt;_StringReplaceBlank&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | Return To Contents]]&lt;br /&gt;
&lt;br /&gt;
== _StringTrimLeftIsEqual ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
| AuthorURL = 35302-guinness&lt;br /&gt;
| AuthorName = guinness&lt;br /&gt;
| Desc = Strip a character/word from the leftmost part of a string.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
ConsoleWrite(_StringTrimLeftIsEqual(&#039;C:\Test&#039;, &#039;C:\&#039;) &amp;amp; @CRLF) ; Returns Test as the string &#039;C:\&#039; is stripped from the left.&lt;br /&gt;
ConsoleWrite(_StringTrimLeftIsEqual(&#039;C:\Test\&#039;, &#039;C&#039;) &amp;amp; @CRLF) ; Returns :\Test as the character &#039;C&#039; is stripped from the left.&lt;br /&gt;
ConsoleWrite(_StringTrimLeftIsEqual(&#039;C:\Test\&#039;, &#039;Test&#039;) &amp;amp; @CRLF) ; Returns the initial string as the string &#039;Test&#039; was not found to the leftmost part of the string.&lt;br /&gt;
&lt;br /&gt;
; Version: 1.00. AutoIt: V3.3.8.1&lt;br /&gt;
; Strip a character/word from the leftmost part of a string.&lt;br /&gt;
Func _StringTrimLeftIsEqual($sString, $sStringTrim)&lt;br /&gt;
    Local $aStringTrim[2] = [0, StringLen($sStringTrim)]&lt;br /&gt;
    Return StringTrimLeft($sString, $aStringTrim[Number(StringLeft($sString, $aStringTrim[1]) == $sStringTrim)])&lt;br /&gt;
EndFunc   ;==&amp;gt;_StringTrimLeftIsEqual&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | Return To Contents]]&lt;br /&gt;
&lt;br /&gt;
== _StringTrimRightIsEqual ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
| AuthorURL = 35302-guinness&lt;br /&gt;
| AuthorName = guinness&lt;br /&gt;
| Desc = Strip a character/word from the rightmost part of a string.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
ConsoleWrite(_StringTrimRightIsEqual(&#039;C:\Test&#039;, &#039;Test&#039;) &amp;amp; @CRLF) ; Returns C:\ as the string &#039;Test&#039; is stripped from the right.&lt;br /&gt;
ConsoleWrite(_StringTrimRightIsEqual(&#039;C:\Test\&#039;, &#039;\&#039;) &amp;amp; @CRLF) ; Returns C:\Test as the character &#039;\&#039; is stripped from the right.&lt;br /&gt;
ConsoleWrite(_StringTrimRightIsEqual(&#039;C:\Test\&#039;, &#039;Test&#039;) &amp;amp; @CRLF) ; Returns the initial string as the string &#039;Test&#039; was not found to the rightmost part of the string.&lt;br /&gt;
&lt;br /&gt;
; Version: 1.00. AutoIt: V3.3.8.1&lt;br /&gt;
; Strip a character/word from the rightmost part of a string.&lt;br /&gt;
Func _StringTrimRightIsEqual($sString, $sStringTrim)&lt;br /&gt;
    Local $aStringTrim[2] = [0, StringLen($sStringTrim)]&lt;br /&gt;
    Return StringTrimRight($sString, $aStringTrim[Number(StringRight($sString, $aStringTrim[1]) == $sStringTrim)])&lt;br /&gt;
EndFunc   ;==&amp;gt;_StringTrimRightIsEqual&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | Return To Contents]]&lt;br /&gt;
&lt;br /&gt;
== StringTrimLeftUntil ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
| AuthorURL = 89462-TheDcoder&lt;br /&gt;
| AuthorName = TheDcoder&lt;br /&gt;
| Desc = Trim a string left until it reaches the delimiter character.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; #FUNCTION# ====================================================================================================================&lt;br /&gt;
; Name ..........: StringTrimLeftUntil&lt;br /&gt;
; Description ...: Trim a string left until it reaches the delimiter charecter&lt;br /&gt;
; Syntax ........: StringTrimLeftUntil($sDelimiter, $sString)&lt;br /&gt;
; Parameters ....: $sDelimiter          - Charecter(s) to trim until&lt;br /&gt;
;                  $sString             - A string value.&lt;br /&gt;
;                  $iOccurrence         - Trim until which occurrence of the delimiter [Default = 1st occurrence]&lt;br /&gt;
; Return values .: Trimmed String&lt;br /&gt;
; Author ........: TheDcoder&lt;br /&gt;
; Modified ......: Thanks to water for the Idea &lt;br /&gt;
; Remarks .......: This function is not case sensitive meaning &amp;quot;DeLiMiTeR&amp;quot; is same as &amp;quot;Delimiter&amp;quot;&lt;br /&gt;
; Related .......: StringTrimLeft&lt;br /&gt;
; Link ..........: https://www.autoitscript.com/forum/topic/139260-autoit-snippets/?do=findComment&amp;amp;comment=1250764&lt;br /&gt;
; Example .......: No&lt;br /&gt;
; ===============================================================================================================================&lt;br /&gt;
Func StringTrimLeftUntil($sDelimiter, $sString, $iOccurrence = 1)&lt;br /&gt;
	$iDelimiterLen = StringLen($sDelimiter)&lt;br /&gt;
    $sString = StringTrimLeft($sString, StringInStr($sString, $sDelimiter, 2, $iOccurrence) + ($iDelimiterLen - 1)) ; This is a little hard to explain:&lt;br /&gt;
	#cs =========================================================================================================================================|&lt;br /&gt;
	| What it does is:                                                                                                                           |&lt;br /&gt;
	| 1. Find the delimiter&#039;s position in the string (StringInStr)                                                                               |&lt;br /&gt;
	| 2. Add delimiter&#039;s Length to delimiters position (I remove 1 for delimiter&#039;s length because StringInStr already contains that 1 charecter) |&lt;br /&gt;
	| 3. Trim the string :)                                                                                                                      |&lt;br /&gt;
	#ce =========================================================================================================================================|&lt;br /&gt;
    Return $sString ; Return the String :D&lt;br /&gt;
EndFunc   ;==&amp;gt;StringTrimLeftUntil&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[#top | Return To Contents]]&lt;br /&gt;
&lt;br /&gt;
== StringTrimRightUntil ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
| AuthorURL = 89462-TheDcoder&lt;br /&gt;
| AuthorName = TheDcoder&lt;br /&gt;
| Desc = Trim a string right until it reaches the delimiter character.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
; #FUNCTION# ====================================================================================================================&lt;br /&gt;
; Name ..........: StringTrimRightUntil&lt;br /&gt;
; Description ...: Trim a string right until it reaches the delimiter charecter&lt;br /&gt;
; Syntax ........: StringTrimRightUntil($sDelimiter, $sString)&lt;br /&gt;
; Parameters ....: $sDelimiter          - Charecter(s) to trim until&lt;br /&gt;
;                  $sString             - A string value.&lt;br /&gt;
;                  $iOccurrence         - Trim until which occurrence of the delimiter [Default = 1st occurrence]&lt;br /&gt;
; Return values .: Trimmed String&lt;br /&gt;
; Author ........: TheDcoder&lt;br /&gt;
; Modified ......: Me&lt;br /&gt;
; Remarks .......: This function is not case sensitive meaning &amp;quot;DeLiMiTeR&amp;quot; is same as &amp;quot;Delimiter&amp;quot;&lt;br /&gt;
; Related .......: StringTrimRight&lt;br /&gt;
; Link ..........: https://www.autoitscript.com/forum/topic/139260-autoit-snippets/?do=findComment&amp;amp;comment=1250764&lt;br /&gt;
; Example .......: No&lt;br /&gt;
; ===============================================================================================================================&lt;br /&gt;
Func StringTrimRightUntil($sDelimiter, $sString, $iOccurrence = 1)&lt;br /&gt;
	$iStringLen = StringLen($sString) ; We need string&#039;s len&lt;br /&gt;
	$iDelimiterLen = StringLen($sDelimiter) ; We need delimiter&#039;s len too&lt;br /&gt;
    $sString = StringTrimRight($sString, ($iStringLen - StringInStr($sString, $sDelimiter, 2, $iOccurrence)) + $iDelimiterLen) ; Explanation:&lt;br /&gt;
	#cs ============================================================================================|&lt;br /&gt;
	| 1. Find delimiters postition                                                                  |&lt;br /&gt;
	| 2. Remove String&#039;s len from delimiters position to invert the trimming process (to the right) |&lt;br /&gt;
	| 3. Add the delimiter&#039;s len to trim the delimiter                                              |&lt;br /&gt;
	| 4. Trim the string!!!                                                                         |&lt;br /&gt;
	#ce ============================================================================================|&lt;br /&gt;
    Return $sString ; Return the String &lt;br /&gt;
EndFunc   ;==&amp;gt;StringTrimRightUntil&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== StringBetween ==&lt;br /&gt;
&lt;br /&gt;
{{Snippet Header&lt;br /&gt;
| AuthorURL = 77301-trong&lt;br /&gt;
| AuthorName = Trong&lt;br /&gt;
| Desc = Find strings between two string delimiters.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;autoit&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; EG---------------------------------------------- -&lt;br /&gt;
Local $sString = StringBetween(&amp;quot;&amp;lt;test&amp;gt;C&amp;lt;/test&amp;gt;&amp;lt;test&amp;gt;B&amp;lt;/test&amp;gt;&amp;lt;test&amp;gt;A&amp;lt;/test&amp;gt;&amp;quot;, &amp;quot;&amp;lt;test&amp;gt;&amp;quot;, &amp;quot;&amp;lt;/test&amp;gt;&amp;quot;)&lt;br /&gt;
MsgBox(0, &amp;quot;StringBetween&amp;quot;, &amp;quot;Strings between &amp;lt;test&amp;gt; and &amp;lt;/test&amp;gt;&amp;quot; &amp;amp; @CRLF &amp;amp; &amp;quot;Is: &amp;quot; &amp;amp; $sString &amp;amp; @CRLF &amp;amp; &amp;quot;In text: &amp;lt;test&amp;gt;C&amp;lt;/test&amp;gt;&amp;lt;test&amp;gt;B&amp;lt;/test&amp;gt;&amp;lt;test&amp;gt;A&amp;lt;/test&amp;gt;&amp;quot;)&lt;br /&gt;
; ------------------------------------------------ -&lt;br /&gt;
&lt;br /&gt;
; #FUNCTION# ====================================================================================================================&lt;br /&gt;
; Name ..........: StringBetween&lt;br /&gt;
; Description ...: Find strings between two string delimiters&lt;br /&gt;
; Syntax ........: StringBetween($sString, $sStart, $sEnd)&lt;br /&gt;
; Parameters ....: $sString         - The string to search.&lt;br /&gt;
; Parameters ....: $sStart          - The beginning of the string to find.&lt;br /&gt;
;                  $sEnd            - The end of the string to find.&lt;br /&gt;
; Return values .: Success: a found string&lt;br /&gt;
;                  Failure: sets the @error flag to non-zero.&lt;br /&gt;
;                  @error: 1 - No strings found.&lt;br /&gt;
; Author ........: Trong&lt;br /&gt;
; Related .......: _StringBetween&lt;br /&gt;
; Link ..........: https://www.autoitscript.com/forum/topic/139260-autoit-snippets/?do=findComment&amp;amp;comment=1290019&lt;br /&gt;
; Example .......: Yes&lt;br /&gt;
; ===============================================================================================================================&lt;br /&gt;
&lt;br /&gt;
Func StringBetween($sString, $sStart, $sEnd)&lt;br /&gt;
	$sString = StringReverse(StringTrimLeft($sString, StringInStr($sString, $sStart) + StringLen($sStart) - 1))&lt;br /&gt;
	$sString = StringReverse(StringTrimLeft($sString, StringInStr($sString, StringReverse($sEnd)) + StringLen($sEnd) - 1))&lt;br /&gt;
	Return SetError(StringLen($sString) = &amp;quot;&amp;quot;, 0, $sString)&lt;br /&gt;
EndFunc   ;==&amp;gt;StringBetween&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[#top | Return To Contents]]&lt;/div&gt;</summary>
		<author><name>Trong</name></author>
	</entry>
</feed>