RutChile 1.1.0
dotnet add package RutChile --version 1.1.0
NuGet\Install-Package RutChile -Version 1.1.0
<PackageReference Include="RutChile" Version="1.1.0" />
paket add RutChile --version 1.1.0
#r "nuget: RutChile, 1.1.0"
// Install RutChile as a Cake Addin #addin nuget:?package=RutChile&version=1.1.0 // Install RutChile as a Cake Tool #tool nuget:?package=RutChile&version=1.1.0
RutChile
Librería para el RUT chileno en C#.
Esta libreria permite generar, validar y limpiar los Rut Unico Tributario (RUT o RUN)
Uso.
- Instalar la libreria con NUGET (buscar por RutChile)
- O descargar la libreria y agregar la dll RutChile.dll a la referencia del proyecto.
- Y usar como
// agregar using EFTEC;
var valido=RutChile.ValidarRut(rut) // devuelve true si el rut es valido.
var dv=RutChile.ObtenerDV(rutSinDV) // obtiene el digito verificador de un rut
var rut=RutChile.GeneraRut();
Tabla de Contenidos
ValidarRut
bool ValidarRut(string rut)
Valida un rut y devuelve true si el rut es valido. En otro caso, devuelve False. El rut puede estar en mayuscula, minuscula y contener puntos.
Ejemplo:
// agregar using EFTEC;
bool valido=RutChile.ValidarRut("123456789-0");
ObtenerDV
string ObtenerDV(string rut)
Obtiene el digito verificador de un rut incompleto. En caso de error, devuelve un "?" El rut puede contener espacios, puntos y estar en mayuscula y minuscula pero no puede contener un digito verificador.
// agregar using EFTEC;
string dv=RutChile.ValidarRut("123456789");
GeneraRut
string GeneraRut(int desde=1,int hasta=99999999)
Genera un rut al azar con digito verificador. El rut generado es de la forma 000000000-0
// agregar using EFTEC;
string rut=RutChile.GeneraRut(1,99999999); // devuelve un rut ejemplo: 123456789-0
ConvierteTipoRut
string ConvierteTipoRut(string rut,int largo=0,bool separador=true,bool dv=true)
Convierte un rut en un rut con/sin largo determinado (ceros a la izquierda) , con/sin separador de miles y con/sin digito verificador.
rut= "5.126.663-3"
string r1=RutChile.ConvierteTipoRut(rut,11,true,true); // 005.126.663-3
rut= "0000001-9";
string r2=RutChile.ConvierteTipoRut(rut,11,true,true); // 000.000.001-9
LimpiaRut
string LimpiaRut(string rut)
Limpia un rut de puntos, espacios al comienzo y final y lo devuelve en mayuscula y con el digito verificador
rut= "5.126.663-3";
string r=RutChile.LimpiaRut(rut); //5126663-3
License
MIT License. RutChile (c) 2019 Jorge Patricio Castro Castillo
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Primera Version