Opened 16 years ago

Closed 15 years ago

#461 closed Feature Request (Completed)

StringReplace to include right-to-left functionality

Reported by: Decker87 Owned by: Jpm
Milestone: Component: AutoIt
Version: Severity: None
Keywords: Cc:


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 Changed 16 years ago by TicketCleanup

  • Version deleted

Automatic ticket cleanup.

comment:2 Changed 16 years ago by WeaponX

I agree. It should accept a negative number like StringInStr. Here is a wrapper for the time being:

$text = StringReplaceReverse("", ".", "-", 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)

comment:3 Changed 16 years ago by Valik

  • Owner set to Valik
  • Status changed from new to accepted

comment:4 Changed 15 years ago by Jpm

  • Owner changed from Valik to Jpm
  • Status changed from accepted to assigned

comment:5 Changed 15 years ago by Jpm

  • Milestone set to
  • Resolution set to Completed
  • Status changed from assigned to closed

Added in version:

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

as closed The owner will remain Jpm.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.