Skip to content

Commit 8e93684

Browse files
committed
add formatting util
1 parent 62cd766 commit 8e93684

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/algora/shared/util.ex

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,4 +268,11 @@ defmodule Algora.Util do
268268
|> Enum.random()
269269
|> DateTime.from_unix!()
270270
end
271+
272+
def compact_org_name(org_name) do
273+
# Remove YC batch strings like "YC S24", "YC W23", etc.
274+
org_name
275+
|> String.replace(~r/\s*\(?YC\s+[a-z]\d{2}\)?\s*/i, "")
276+
|> String.trim()
277+
end
271278
end

0 commit comments

Comments
 (0)