I usually check .nix files in "
https://github.com/NixOS/nixpkgs/tree/master/lib"; folder when searching for
basic functions. String manipulation functions are in "strings.nix".

On your case, this should work:

nix-repl> with (import <nixpkgs/lib>); concatStrings (take 16
(stringToCharacters "0123456789abcdefghijklmnop"))
"0123456789abcdef"

On Mon, 25 Jan 2016 at 18:16 4levels <[email protected]> wrote:

> Dear Nix Devs,
>
> I'm currently looking (again) for the basic string functions.
> Use case: I need to limit a parametric string's length to maximum 16
> characters (indeed, MySql usernames cannot be longer than 16 characters).
>
> Any hints in the right direction to substring a string in case it is
> longer than 16 chars are greatly appreciated ;-)
>
> Kind regards,
>
> Erik aka 4levels
> _______________________________________________
> nix-dev mailing list
> [email protected]
> http://lists.science.uu.nl/mailman/listinfo/nix-dev
>
_______________________________________________
nix-dev mailing list
[email protected]
http://lists.science.uu.nl/mailman/listinfo/nix-dev

Reply via email to