CaptainBeardsEyesBeard Posted September 7, 2020 Posted September 7, 2020 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
Developers Jos Posted September 7, 2020 Developers Posted September 7, 2020 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.
pseakins Posted September 7, 2020 Posted September 7, 2020 In the StringTrimLeft() statement, one (1) should be subtracted from the $iPosition value. Ie; $aTableData[2][1]=StringTrimLeft($aTableData[2][1], $iPosition - 1) Phil Seakins
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now