Skip to content

Commit

Permalink
Add utility function to convert string to 2D array
Browse files Browse the repository at this point in the history
  • Loading branch information
wiktoriavh committed Dec 16, 2024
1 parent 900f365 commit 8c4631b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions utils/to2d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export function to2D(input: string, split: string = ""): string[][] {
return input.split("\n").map((line) => line.split(split));
}

0 comments on commit 8c4631b

Please sign in to comment.