tsbase
Version:
Base class libraries for TypeScript
35 lines (34 loc) • 1.31 kB
TypeScript
export declare class Strings {
private constructor();
static readonly Empty = "";
static readonly Space = " ";
/**
* Returns the camel cased version of the given string
* NOTE: For multi word strings that are not separated by spaces, this function will merely lowercase the first character
* @param string
*/
static CamelCase(string: string): string;
/**
* Returns the pascal cased version of the given string
* NOTE: For multi word strings that are not separated by spaces, this function will merely uppercase the first character
* @param string
*/
static PascalCase(string: string): string;
/**
* Returns true if the given string is null, empty, or consists purely of whitespace
* @param string
*/
static IsEmptyOrWhiteSpace(string: string | null | undefined): boolean;
/**
* Returns a version of the given string minus new line characters and whitespace characters between tags
* @param string
*/
static MinifyXml(string: string): string;
/**
* Returns a "slugified" version of the given string
* Replaces white space with dashes "-", removes non-alphanumeric characters, and lowercases
* @param string
* @returns
*/
static Slugify(string: string): string;
}