mirror of
https://github.com/vxunderground/VX-API
synced 2024-06-30 18:51:17 +00:00
Create StringTerminateStringAtChar.cpp
This commit is contained in:
parent
70e260060e
commit
36dd02c039
31
String Manipulation/StringTerminateStringAtChar.cpp
Normal file
31
String Manipulation/StringTerminateStringAtChar.cpp
Normal file
@ -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;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user