Skip to content
This repository was archived by the owner on Dec 1, 2023. It is now read-only.

Commit

Permalink
stdlib extensions with lombok
Browse files Browse the repository at this point in the history
  • Loading branch information
nothub committed Dec 5, 2022
1 parent 8732368 commit bcfc086
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
plugins {
id 'java'
id "io.freefair.lombok" version "6.6"
}

group = 'lol.hub.aoc'
Expand Down
11 changes: 11 additions & 0 deletions src/main/java/lol/hub/aoc/util/StringExtensions.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package lol.hub.aoc.util;

public class StringExtensions {
public static String nth(String input, int start, int distance) {
StringBuilder sb = new StringBuilder();
for (int i = start; i < input.length(); i = i + distance) {
sb.append(input.charAt(i));
}
return sb.toString();
}
}

0 comments on commit bcfc086

Please sign in to comment.