tiago wrote:How to read each filename up to letter in position X from left to right, right to left...? Is there a command I am missing?
substr() gives me a specific string but not whole sections.
strpos() and strlen() are close but amiss either.
What do you mean by "whole sections" ?
Examples please.
substr(string, [start], [length])
Give me first three signs of string "string":
msg substr( "string" , , 3 ); // 'str'
Give me last three signs of string "string":
::msg substr( "string" , strlen( "string" ) -3 , ); // 'ing'
Give me three signs starting at sign 2 of string "string":
::msg substr("string", 1, 3); // 'tri'
Note:
Calculation starts from '0': first sign/char is at pos '0'
Start point '0' and end point 'last sign of string' are implicit and must not be entered into the command.