PalacePal/Pal.Client/Extensions/GuidExtensions.cs

13 lines
323 B
C#
Raw Normal View History

2023-02-11 20:10:45 +00:00
using System;
2023-03-30 20:01:43 +00:00
namespace Pal.Client.Extensions;
public static class GuidExtensions
2023-02-11 20:10:45 +00:00
{
2023-03-30 20:01:43 +00:00
public static string ToPartialId(this Guid g, int length = 13)
=> g.ToString().ToPartialId();
2023-02-11 20:10:45 +00:00
2023-03-30 20:01:43 +00:00
public static string ToPartialId(this string s, int length = 13)
=> s.PadRight(length + 1).Substring(0, length);
2023-02-11 20:10:45 +00:00
}