Add / Remove Components

This commit is contained in:
Simon Lübeß
2022-04-10 12:18:43 +02:00
parent af37154071
commit bca72cf0d4
4 changed files with 302 additions and 192 deletions
@@ -0,0 +1,21 @@
namespace System
{
extension String
{
[Inline]
public void CopyTo(Span<char8> target)
{
CopyTo(target.Ptr, target.Length);
}
[Inline]
public void CopyTo(char8* target, int targetLength)
{
int copiedChars = Math.Min(targetLength - 1, Length);
Internal.MemCpy(target, Ptr, copiedChars);
target[copiedChars] = '\0';
}
}
}