Skip to content

Commit

Permalink
'StringView::substring(int)'
Browse files Browse the repository at this point in the history
  • Loading branch information
Glavo committed Dec 17, 2022
1 parent 8113561 commit 652ef0d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ loadMavenPublishProperties()

allprojects {
group = "org.glavo.kala"
version = "0.60.0"// + "-SNAPSHOT"
version = "0.60.1"// + "-SNAPSHOT"

description = "Basic components of Kala"

Expand Down
4 changes: 4 additions & 0 deletions kala-base/src/main/java/kala/text/StringView.java
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ public byte[] getBytes(Charset charset, int beginIndex, int endIndex) {
return this.substring(start, end);
}

public @NotNull StringView substring(int beginIndex) {
return substring(beginIndex, length);
}

public @NotNull StringView substring(int beginIndex, int endIndex) {
Conditions.checkPositionIndices(beginIndex, endIndex, length);
return beginIndex != endIndex ? new StringView(value, offset + beginIndex, endIndex - beginIndex) : EMPTY;
Expand Down

0 comments on commit 652ef0d

Please sign in to comment.