extract.c

skylib_fluffos_v3/mudlib/secure/simul_efun/extract.c · 522 B

From the archive skylib_fluffos_v3.zip

Download the archive   « Back to the archive contents

/**
 * This method extracts characters from a string and returns them.
 * @param str the input string to extract from
 * @param start the character to start extracting from
 * @param end the character to start extracting from
 * @return the extracted characters
 * @example
 *     extract("bingle", 3 ) will return "gle"
 *     extract("bingle", 3, 4 ) will return "gl"
 */
varargs string extract( string str, int start, int end ) {
    if( end )
        return str[start..end];
    return str[start..];
} /* extract() */

Site Stats

Snippets: 1791
Codebases: 571