export class CountryCode {
    name: string;
    /* starts with + */
    code: string;
    countryCode: string;
    maxLength: number;
    minLength: number;
    pattern: string;
    number?: string;
    isValid?: boolean;

    /*
        return number without +
    */
    public static localNumber(code: string, number: string): string {
        if (code && number) {
            return CountryCode.localCode(code) + number;
        } else {
            return '';
        }
    }

    /*
    remove start +
    */
    public static localCode(code: string): string {
        if (code) {
            return code.substr(1, code.length - 1);
        } else {
            return '';
        }
    }

}
