Replace `isWhitespaceAt` with `trimmedLeftIndex` and `trimmedRightIndex`.