in reply to Re^2: Can you set a character in a string at a given index directly?
in thread Can you set a character in a string at a given index directly?
The return value of substr is an lvalue (assuming the original string is an lvalue), which is a fancy way of saying that it can be assigned to. So, the chunk of the data returned by substr can be assigned to. The four argument version of this call is (basically) equivalent.
substr( $string, $index, # starting from 0 1, # how many characters ) = $replacement;
--MidLifeXis
|
|---|