Here are the examples of the csharp api string.RemoveDoubleSpaces() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
3 Examples
19
Source : ACBrConsultaCNPJ.cs
with MIT License
from ACBrNet
with MIT License
from ACBrNet
private static ACBrEmpresa ProcessResponse(string retorno)
{
var result = new ACBrEmpresa();
try
{
var retornoRfb = new List<string>();
retornoRfb.AddText(retorno.StripHtml());
retornoRfb.RemoveEmptyLines();
result.CNPJ = LerCampo(retornoRfb, "NÚMERO DE INSCRIÇÃO");
if (!result.CNPJ.IsEmpty()) result.TipoEmpresa = LerCampo(retornoRfb, result.CNPJ);
result.DataAbertura = LerCampo(retornoRfb, "DATA DE ABERTURA").ToData();
result.RazaoSocial = LerCampo(retornoRfb, "NOME EMPRESARIAL");
result.NomeFantasia = LerCampo(retornoRfb, "TÍTULO DO ESTABELECIMENTO (NOME DE FANTASIA)");
result.CNAE1 = LerCampo(retornoRfb, "CÓDIGO E DESCRIÇÃO DA ATIVIDADE ECONÔMICA PRINCIPAL");
result.Logradouro = LerCampo(retornoRfb, "LOGRADOURO");
result.Numero = LerCampo(retornoRfb, "NÚMERO");
result.Complemento = LerCampo(retornoRfb, "COMPLEMENTO");
result.CEP = LerCampo(retornoRfb, "CEP").FormataCEP();
result.Bairro = LerCampo(retornoRfb, "BAIRRO/DISTRITO");
result.Municipio = LerCampo(retornoRfb, "MUNICÍPIO");
result.UF = (ConsultaUF)Enum.Parse(typeof(ConsultaUF), LerCampo(retornoRfb, "UF").ToUpper());
result.Situacao = LerCampo(retornoRfb, "SITUAÇÃO CADASTRAL");
result.DataSituacao = LerCampo(retornoRfb, "DATA DA SITUAÇÃO CADASTRAL").ToData();
result.NaturezaJuridica = LerCampo(retornoRfb, "CÓDIGO E DESCRIÇÃO DA NATUREZA JURÍDICA");
result.EndEletronico = LerCampo(retornoRfb, "ENDEREÇO ELETRÔNICO");
if (result.EndEletronico == "TELEFONE") result.EndEletronico = string.Empty;
result.Telefone = LerCampo(retornoRfb, "TELEFONE");
result.EFR = LerCampo(retornoRfb, "ENTE FEDERATIVO RESPONSÁVEL (EFR)");
result.MotivoSituacao = LerCampo(retornoRfb, "MOTIVO DE SITUAÇÃO CADASTRAL");
result.SituacaoEspecial = LerCampo(retornoRfb, "SITUAÇÃO ESPECIAL");
result.DataSituacaoEspecial = LerCampo(retornoRfb, "DATA DA SITUAÇÃO ESPECIAL").ToData();
var listCNAE2 = new List<string>();
var aux = LerCampo(retornoRfb, "CÓDIGO E DESCRIÇÃO DAS ATIVIDADES ECONÔMICAS SECUNDÁRIAS");
if (!aux.IsEmpty()) listCNAE2.Add(aux.RemoveDoubleSpaces());
do
{
aux = LerCampo(retornoRfb, aux);
if (!aux.IsEmpty()) listCNAE2.Add(aux.RemoveDoubleSpaces());
} while (!aux.IsEmpty());
result.CNAE2 = listCNAE2.ToArray();
}
catch (Exception exception)
{
throw new ACBrException(exception, "Erro ao processar retorno.");
}
return result;
}
19
Source : ConsultaSintegraBA.cs
with MIT License
from ACBrNet
with MIT License
from ACBrNet
private static string LerCampo(IList<string> retorno, string campo)
{
var ret = string.Empty;
for (var i = 0; i < retorno.Count; i++)
{
var linha = retorno[i].Trim();
if (linha != campo) continue;
ret = retorno[i + 1].Trim().Replace(" ", string.Empty);
retorno.RemoveAt(i);
break;
}
return ret.RemoveDoubleSpaces();
}
19
Source : ACBrPessoa.cs
with MIT License
from ACBrNet
with MIT License
from ACBrNet
private void ProcessResponse(string retorno)
{
var retornoRfb = new List<string>();
try
{
retorno = HttpUtility.HtmlDecode(retorno);
retorno = retorno.StripHtml().RemoveDoubleSpaces();
retorno = retorno.Replace("\t", string.Empty);
retornoRfb.AddText(retorno);
retornoRfb.RemoveEmptyLines();
CPF = LerCampo(retornoRfb, "N� do CPF:");
Nome = LerCampo(retornoRfb, "Nome:");
DataNascimento = LerCampo(retornoRfb, "Data Nascimento:").ToData();
Situacao = LerCampo(retornoRfb, "Situa��o Cadastral:");
DataInscricao = LerCampo(retornoRfb, "Data de Inscri��o no CPF:").ToData();
DigitoVerificador = LerCampo(retornoRfb, "D�gito Verificador:");
Emissao = LerCampo(retornoRfb, "Comprovante emitido �s:");
CodCtrlControle = LerCampo(retornoRfb, "C�digo de controle do comprovante:");
}
catch (Exception exception)
{
throw new ACBrException(exception, "Erro ao processar retorno.");
}
if (!Nome.IsEmpty()) return;
var erro = LerCampo(retornoRfb, "Data de nascimento informada");
Guard.Against<ACBrException>(!erro.IsEmpty(), "Data de nascimento divergente da base da Receita Federal.");
throw new ACBrException("N�o foi poss�vel obter os dados.");
}