BOOTSTRAP (kutils) functions


LIBRARY ROUTINE

kstrchr - find a character in a string

LIBRARY CALL

char *kstrchr(
   const char *istr,
   int         character)

INPUT

OUTPUT

none

RETURN VALUE

A pointer to the address in the input string where the 'character' character is located. NULL is returned if 'character' is not in the input string, or if the input string is NULL.

DESCRIPTION

This function finds the first occurence of a specified character in a given string. This routine is similar to the system strchr() call. kstrchr() searches the input string, 'istr', for the first occurrence of a character, 'character'. The terminating null character is included in the search, and can be the specified character to search for.

ADDITIONAL INFORMATION

none

EXAMPLES

The following example takes a sentence, and uses kstrchr() to shorten it for use in a different sentence.
char *s1 = "Hello World.";
char *result;

result = kstrchr(s1, 'W'); kprintf("Goodbye Cruel %s\n", result);

The output string is 'Goodbye Cruel World.'

SIDE EFFECTS

none

RESTRICTIONS

none

MODIFICATION

none

FILES

$BOOTSTRAP/objects/library/kutils/src/strings.c

SEE ALSO

kutils(3)

COPYRIGHT

Copyright (C) 1993 - 1997, Khoral Research, Inc. ("KRI") All rights reserved.