Jump to content

Searching for a phrase and trimming a string


Recommended Posts

Hi I'm trying to search for a phrase then trim the string from left once finding that phrase  

So i did this

 

_ArrayDisplay($aTableData)


Local $iPosition = StringInStr($aTableData[2][1], "Total Value of Payments :")
StringTrimLeft($aTableData[2][1], $iPosition)
ConsoleWrite(@CRLF & "Outputting $iPosition " & $iPosition)

ConsoleWrite(@CRLF & "Outputting table after it's been trimmed")
ConsoleWrite(@CRLF & $aTableData[2][1])

However it doesn't seem to trim the string as I get the following output which is the same string as if I don't use StringTrimLeft at all? 

Outputting $iPosition 117
Outputting table after it's been trimmed

Status DescriptionNumber of PaymentsValue of Payments

Waiting for Credit Controller666



Total Value of Payments : 666


 >Exit code: 0    Time: 35.24

 

Link to comment
Share on other sites

  • Developers

Makes sense as the result isn't stored anywhere. Try something like this:

$aTableData[2][1]=StringTrimLeft($aTableData[2][1], $iPosition)

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...