Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- - StringFunctions -
- by: jCause
- date: 2014
- Version: 1.0
- Funkcijos:
- - GetSymbolRowNumber( const e_symbol[], const e_string[] )
- - IsSymbolInString( const e_symbol[], const e_string[] )
- - IsStringEmpty( const e_string[] )
- - IsStringSize( const e_string[], const e_size )
- - IsStringInArray(const e_string[], const e_array[][], const e_array_size = sizeof e_array)
- */
- stock GetSymbolRowNumber( const e_symbol[], const e_string[] )
- {
- for( new stringLoop; stringLoop < strlen(e_string); stringLoop++ )
- {
- if( !strcmp(e_string[stringLoop], e_symbol, true) )
- {
- return stringLoop;
- }
- }
- return -1;
- }
- stock IsSymbolInString( const e_symbol[], const e_string[] )
- {
- for( new stringLoop; stringLoop < strlen(e_string); stringLoop++ )
- {
- if( !strcmp(e_string[stringLoop], e_symbol, true) )
- {
- return(true);
- }
- }
- return(false);
- }
- stock IsStringEmpty( const e_string[] )
- {
- if( strlen(e_string) == 0 )
- {
- return(true);
- }
- else
- return(false);
- }
- stock IsStringSize( const e_string[], const e_size )
- {
- if( strlen(e_string) == e_size )
- {
- return(true);
- }
- else
- return(false);
- }
- stock bool:IsStringInArray(const e_string[], const e_array[][], const e_array_size = sizeof e_array)
- {
- new e_string_row = 0;
- while(e_string_row < e_array_size)
- {
- if(!strcmp(e_string, e_array[e_string_row], true))
- {
- return true;
- }
- ++e_string_row;
- }
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement