We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
substrings
1 parent 836bc0e commit fa8fe8bCopy full SHA for fa8fe8b
src/org/rascalmpl/library/String.rsc
@@ -748,7 +748,7 @@ str(str) indentTabsAsSpaces(int tabSize) {
748
* The number of substrings is quadratic in the size of the string; expensive to compute.
749
}
750
set[str] substrings(str input)
751
- = {input[i..i+l] | int i <- [0..size(input)], int l <- [1..size(input)], i + l <= size(input)};
+ = {input[i..i+l] | int i <- [0..size(input)], int l <- [1..size(input)-i+1]} - input;
752
753
@synopsis{If a string does not end with a newline character, append one. }
754
str insertFinalNewline(str input, list[str] lineseps = newLineCharacters)
0 commit comments