ƒ.string - Get-Kraken/fixx GitHub Wiki
make.guid()
returns a guid that is hyphen separated into 5 groups (read https://en.wikipedia.org/wiki/Globally_unique_identifier)
example:
ƒ.string.make.guid(); // → "db01f33b-a59b-f094-a946-d49dc264a895"
br2nl('text')
used to replace break tags in raw text and replace with \r\n
nl2br('text')
used to replace \r\n
with <br />
use case: when on screen text is clickable to make it editable in a text box. The text box will show the break tags within the text if not converted to new lines.
var str = ƒ.string.convert.br2nl('foo<br>bar');
/* →
"foo \r\n
bar"
*/
ƒ.string.convert.nl2br(str);
/* →
"foo<br />bar"
*/
Can also be used to prepare text for saving back to a database.
contains(string, term)
string
text to be searched
term
term to be searched for in string
return → true/false
example:
ƒ.string.contains('foobar', 'bar'); // → true