dave-csc commented on issue #4624:
URL: https://github.com/apache/hop/issues/4624#issuecomment-3106604637

   Back on this issue, before updating the documentation in the wild 😅 
   
   The counter-intuitive part is actually in these lines:
   ```
         } else if ((cutFrom < 0 && cutTo < 0) && (cutFrom < cutTo)) {
           rcode = null;
   ...
           } else if (cutFrom < 0 && cutTo < 0) {
             rcode = rcode.substring(rcode.length() + cutTo, lenCode + cutFrom);
   ```
   
   I think the roles of `cutFrom` and `cutTo` should be swapped here: if I need 
to get `abcde` from the string `...vwxyzabcdefghij`, it has more sense to 
specify `cutFrom = -10` and `cutTo = -5`, rather than the opposite.
   
   With the code above, the `rcode` variable is valued to `null` since `cutFrom 
< cutTo`, whereas it has the intended string if `cutFrom >= cutTo` instead.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to