PortValhalla/lib/text.nix
2024-11-29 01:15:08 +01:00

7 lines
222 B
Nix

{ lib, ... }: {
capitalize = text:
let chars = lib.strings.stringToCharacters text;
in lib.strings.concatStrings
([ (lib.strings.toUpper (builtins.elemAt chars 0)) ]
++ (lib.lists.drop 1 chars));
}