Modify ↓
#461 closed Feature Request (Completed)
StringReplace to include right-to-left functionality
| Reported by: | Decker87 | Owned by: | Jpm |
|---|---|---|---|
| Milestone: | 3.3.1.0 | Component: | AutoIt |
| Version: | Severity: | None | |
| Keywords: | Cc: |
Description
This request is simple. I think the StringReplace function should include an optional parameter to X number of instances of a string starting from the right instead of the left.
Attachments (0)
Change History (5)
comment:1 by , on Jul 25, 2008 at 2:00:14 AM
| Version: | 3.2.12.0 |
|---|
comment:2 by , on Jul 25, 2008 at 3:47:35 PM
I agree. It should accept a negative number like StringInStr. Here is a wrapper for the time being:
$text = StringReplaceReverse("this.is.a.line.of.text", ".", "-", 2)
ConsoleWrite($text & @CRLF)
Func StringReplaceReverse($sString, $sSearch, $sReplace, $iCount)
$iIndex = StringInStr($sString, $sSearch,0,-$iCount)
$sLeft = StringLeft($sString, $iIndex-1)
$sRight = StringMid($sString, $iIndex)
Return $sLeft & StringReplace($sRight,$sSearch, $sReplace)
EndFunc
comment:3 by , on Jul 26, 2008 at 4:27:04 PM
| Owner: | set to |
|---|---|
| Status: | new → accepted |
comment:4 by , on Feb 2, 2009 at 5:46:03 PM
| Owner: | changed from to |
|---|---|
| Status: | accepted → assigned |
comment:5 by , on Feb 5, 2009 at 12:54:44 PM
| Milestone: | → 3.3.1.0 |
|---|---|
| Resolution: | → Completed |
| Status: | assigned → closed |
Added in version: 3.3.1.0
Note:
See TracTickets
for help on using tickets.

Automatic ticket cleanup.