hippofish/src/prelude/string.ts

16 lines
354 B
TypeScript
Raw Normal View History

2018-11-09 05:03:46 +01:00
export function concat(xs: string[]): string {
2018-12-19 13:20:25 +01:00
return xs.reduce((a, b) => a + b, '');
2018-11-09 05:03:46 +01:00
}
2018-09-06 20:22:55 +02:00
export function capitalize(s: string): string {
2018-09-11 23:33:02 +02:00
return toUpperCase(s.charAt(0)) + toLowerCase(s.slice(1));
2018-09-11 20:51:33 +02:00
}
export function toUpperCase(s: string): string {
return s.toUpperCase();
2018-09-06 20:22:55 +02:00
}
2018-09-11 23:33:02 +02:00
export function toLowerCase(s: string): string {
return s.toLowerCase();
}