mirror of
https://github.com/vxunderground/VX-API
synced 2026-06-06 16:54:55 +00:00
Create StringTerminateStringAtChar.cpp
This commit is contained in:
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user