Trim
This commit is contained in:
parent
88003892a0
commit
ee19be74d9
@ -104,7 +104,7 @@ public class Person
|
|||||||
log.Information(". . .");
|
log.Information(". . .");
|
||||||
if (string.IsNullOrEmpty(line) || line.Length < 2)
|
if (string.IsNullOrEmpty(line) || line.Length < 2)
|
||||||
continue;
|
continue;
|
||||||
firstName = line;
|
firstName = line.Trim();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (firstName is null)
|
if (firstName is null)
|
||||||
@ -117,7 +117,7 @@ public class Person
|
|||||||
log.Information(". . .");
|
log.Information(". . .");
|
||||||
if (string.IsNullOrEmpty(line) || line.Length < 2)
|
if (string.IsNullOrEmpty(line) || line.Length < 2)
|
||||||
continue;
|
continue;
|
||||||
lastName = line;
|
lastName = line.Trim();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (lastName is null)
|
if (lastName is null)
|
||||||
@ -143,6 +143,8 @@ public class Person
|
|||||||
log.Information(". . .");
|
log.Information(". . .");
|
||||||
if (consoleKey is not ConsoleKey.Y and not ConsoleKey.N)
|
if (consoleKey is not ConsoleKey.Y and not ConsoleKey.N)
|
||||||
continue;
|
continue;
|
||||||
|
else if (consoleKey is ConsoleKey.N)
|
||||||
|
break;
|
||||||
deceased = consoleKey == ConsoleKey.Y;
|
deceased = consoleKey == ConsoleKey.Y;
|
||||||
dateTime = null;
|
dateTime = null;
|
||||||
approximateYears = null;
|
approximateYears = null;
|
||||||
@ -162,11 +164,11 @@ public class Person
|
|||||||
log.Information(". . .");
|
log.Information(". . .");
|
||||||
if (string.IsNullOrEmpty(line) || !int.TryParse(line, out _))
|
if (string.IsNullOrEmpty(line) || !int.TryParse(line, out _))
|
||||||
continue;
|
continue;
|
||||||
approximateYears = line;
|
approximateYears = line.Trim();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
month = line;
|
month = line.Trim();
|
||||||
log.Information("Enter persons birthday day (press enter if not known)");
|
log.Information("Enter persons birthday day (press enter if not known)");
|
||||||
line = System.Console.ReadLine();
|
line = System.Console.ReadLine();
|
||||||
log.Information(". . .");
|
log.Information(". . .");
|
||||||
@ -177,16 +179,16 @@ public class Person
|
|||||||
log.Information(". . .");
|
log.Information(". . .");
|
||||||
if (string.IsNullOrEmpty(line) || !int.TryParse(line, out _))
|
if (string.IsNullOrEmpty(line) || !int.TryParse(line, out _))
|
||||||
continue;
|
continue;
|
||||||
approximateYears = line;
|
approximateYears = line.Trim();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
day = line;
|
day = line.Trim();
|
||||||
log.Information("Enter persons birthday year (press enter if not known)");
|
log.Information("Enter persons birthday year (press enter if not known)");
|
||||||
line = System.Console.ReadLine();
|
line = System.Console.ReadLine();
|
||||||
log.Information(". . .");
|
log.Information(". . .");
|
||||||
if (!string.IsNullOrEmpty(line))
|
if (!string.IsNullOrEmpty(line))
|
||||||
year = line;
|
year = line.Trim();
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
log.Information("Enter persons approximate age");
|
log.Information("Enter persons approximate age");
|
||||||
@ -194,7 +196,7 @@ public class Person
|
|||||||
log.Information(". . .");
|
log.Information(". . .");
|
||||||
if (string.IsNullOrEmpty(line) || !int.TryParse(line, out _))
|
if (string.IsNullOrEmpty(line) || !int.TryParse(line, out _))
|
||||||
continue;
|
continue;
|
||||||
approximateYears = line;
|
approximateYears = line.Trim();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -223,7 +225,7 @@ public class Person
|
|||||||
log.Information(". . .");
|
log.Information(". . .");
|
||||||
if (!string.IsNullOrEmpty(line))
|
if (!string.IsNullOrEmpty(line))
|
||||||
{
|
{
|
||||||
uri = new(line);
|
uri = new(line.Trim());
|
||||||
if (uri.HostNameType != UriHostNameType.Dns)
|
if (uri.HostNameType != UriHostNameType.Dns)
|
||||||
continue;
|
continue;
|
||||||
task = httpClient.GetByteArrayAsync(uri);
|
task = httpClient.GetByteArrayAsync(uri);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user