Get Segments

This commit is contained in:
2022-09-20 20:24:03 -07:00
parent b24d3b9c8d
commit 90244811ed
7 changed files with 60 additions and 54 deletions

View File

@ -6,7 +6,7 @@ public interface ILocation
string TestStatic_GetRightPadded(int locationDigits, string value) =>
GetRightPadded(locationDigits, value);
static string GetRightPadded(int locationDigits, string value) =>
value.PadRight(locationDigits, '0');
value.Length == locationDigits ? value : value.Length > locationDigits ? value[..locationDigits] : value.PadRight(locationDigits, '0');
string TestStatic_GetRightPadded(int locationDigits, int value) =>
GetRightPadded(locationDigits, value);