Create StringTerminateStringAtChar.cpp

This commit is contained in:
vxunderground 2022-07-14 22:28:14 -05:00 committed by GitHub
parent 70e260060e
commit 36dd02c039
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,31 @@
PCHAR StringTerminateStringAtCharA(PCHAR String, INT Character)
{
DWORD Length = (DWORD)StringLengthA(String);
for (DWORD Index = 0; Index < Length; Index++)
{
if (String[Index] == Character)
{
String[Index] = '\0';
return String;
}
}
return NULL;
}
PWCHAR StringTerminateStringAtCharW(PWCHAR String, INT Character)
{
DWORD Length = (DWORD)StringLengthW(String);
for (DWORD Index = 0; Index < Length; Index++)
{
if (String[Index] == Character)
{
String[Index] = '\0';
return String;
}
}
return NULL;
}