Modify

Opened 18 years ago

Closed 17 years ago

#461 closed Feature Request (Completed)

StringReplace to include right-to-left functionality

Reported by: Decker87 Owned by: J-Paul Mesnage
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 TicketCleanup, 18 years ago

Version: 3.2.12.0

Automatic ticket cleanup.

comment:2 by WeaponX, 18 years ago

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 Valik, 18 years ago

Owner: set to Valik
Status: newaccepted

comment:4 by J-Paul Mesnage, 17 years ago

Owner: changed from Valik to J-Paul Mesnage
Status: acceptedassigned

comment:5 by J-Paul Mesnage, 17 years ago

Milestone: 3.3.1.0
Resolution: Completed
Status: assignedclosed

Added in version: 3.3.1.0

Modify Ticket

Action
as closed The owner will remain J-Paul Mesnage.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.