コード例 #1
0
        public static Int64 ToInt64(string txt)
        {
            txt = TextoHelpers.GetNumeros(txt);
            Int64 inteiro;

            Int64.TryParse(txt, out inteiro);
            return(inteiro);
        }
コード例 #2
0
        public static string GetCpfCnpjSemZeros(string cpfCnpj)
        {
            cpfCnpj = TextoHelpers.GetNumeros(cpfCnpj);
            while (cpfCnpj.StartsWith("0"))
            {
                cpfCnpj = cpfCnpj.Substring(1);
            }

            return(cpfCnpj);
        }
コード例 #3
0
        public static string CpfCompleto(string cpf)
        {
            cpf = TextoHelpers.GetNumeros(cpf);

            if (string.IsNullOrEmpty(cpf))
            {
                return("");
            }

            while (cpf.Length < 11)
            {
                cpf = "0" + cpf;
            }

            return(cpf);
        }
コード例 #4
0
        public static string CpfLimpo(string cpf)
        {
            cpf = TextoHelpers.GetNumeros(cpf);

            if (string.IsNullOrEmpty(cpf))
            {
                return("");
            }

            while (cpf.StartsWith("0"))
            {
                cpf = cpf.Substring(1);
            }

            return(cpf);
        }
コード例 #5
0
        public static string CnpjLimpo(string cnpj)
        {
            cnpj = TextoHelpers.GetNumeros(cnpj);

            if (string.IsNullOrEmpty(cnpj))
            {
                return("");
            }

            while (cnpj.StartsWith("0"))
            {
                cnpj = cnpj.Substring(1);
            }

            return(cnpj);
        }