HoS_PRC8/_mod/_module/nss/rtsa_headerp.nss
Jaysyn904 04165202c0 Initial upload
Initial upload
2024-11-25 19:36:07 -05:00

34 lines
1.2 KiB
Plaintext

///////////////////////////////////////////////////////////////////////////////////
// REAL TIME STRATEGY ADVENTURE - Kit
// FILE:rtsa_headerp
// NAME: Header file Parser
// SCRIPTED BY: Deva Bryson Winblood
// DATE: 03/26/2003
///////////////////////////////////////////////////////////////////////////////////
/* This header contains the parser functions for processing names and storing
data. It does not need to included unless you need to parse something. */
string fnParse(string sIn,string sDelim=".")
{ // Parse string using delimiter
string sRet="";
string sWork=sIn;
while(GetStringLeft(sWork,1)!=sDelim&&GetStringLength(sWork)>0)
{ // build return string
sRet=sRet+GetStringLeft(sWork,1);
sWork=GetStringRight(sWork,GetStringLength(sWork)-1);
} // build return string
return sRet;
} // fnParse()
string fnRemoveParsed(string sIn, string sRemove, string sDelim=".")
{ // remove parsed portion of string and return the remaining
string sRet="";
if (GetStringLength(sIn)>=GetStringLength(sRemove))
{ // strip it
sRet=GetStringRight(sIn,GetStringLength(sIn)-GetStringLength(sRemove));
if (GetStringLeft(sRet,1)==sDelim)
sRet=GetStringRight(sRet,GetStringLength(sRet)-1);
} // strip it
return sRet;
} // fnRemoveParsed()