# string_utils
[utilities]

## Functions
AXIS2_EXTERN void * | axutil_strdup (const axutil_env_t *env, const void *ptr)
AXIS2_EXTERN void * | axutil_strndup (const axutil_env_t *env, const void *ptr, int n)
AXIS2_EXTERN void * | axutil_strmemdup (const void *ptr, size_t n, const axutil_env_t *env)
AXIS2_EXTERN void * | axutil_memchr (const void *ptr, int c, size_t n)
AXIS2_EXTERN int | axutil_strcmp (const axis2_char_t *s1, const axis2_char_t *s2)
AXIS2_EXTERN int | axutil_strncmp (const axis2_char_t *s1, const axis2_char_t *s2, int n)
AXIS2_EXTERN axis2_ssize_t | axutil_strlen (const axis2_char_t *s)
AXIS2_EXTERN int | axutil_strcasecmp (const axis2_char_t *s1, const axis2_char_t *s2)
AXIS2_EXTERN int | axutil_strncasecmp (const axis2_char_t *s1, const axis2_char_t *s2, const int n)
AXIS2_EXTERN axis2_char_t * | axutil_stracat (const axutil_env_t *env, const axis2_char_t *s1, const axis2_char_t *s2)
AXIS2_EXTERN axis2_char_t * | axutil_strcat (const axutil_env_t *env,...)
AXIS2_EXTERN axis2_char_t * | axutil_strstr (const axis2_char_t *heystack, const axis2_char_t *needle)
AXIS2_EXTERN axis2_char_t * | axutil_strchr (const axis2_char_t *s, axis2_char_t ch)
AXIS2_EXTERN axis2_char_t * | axutil_rindex (const axis2_char_t *s, axis2_char_t c)
AXIS2_EXTERN axis2_char_t * | axutil_replace (const axutil_env_t *env, axis2_char_t *str, int s1, int s2)
AXIS2_EXTERN axis2_char_t * | axutil_strltrim (const axutil_env_t *env, const axis2_char_t *_s, const axis2_char_t *_trim)
AXIS2_EXTERN axis2_char_t * | axutil_strrtrim (const axutil_env_t *env, const axis2_char_t *_s, const axis2_char_t *_trim)
AXIS2_EXTERN axis2_char_t * | axutil_strtrim (const axutil_env_t *env, const axis2_char_t *_s, const axis2_char_t *_trim)
AXIS2_EXTERN axis2_char_t * | axutil_string_replace (axis2_char_t *str, axis2_char_t old_char, axis2_char_t new_char)
AXIS2_EXTERN axis2_char_t * | axutil_string_substring_starting_at (axis2_char_t *str, int s)
AXIS2_EXTERN axis2_char_t * | axutil_string_substring_ending_at (axis2_char_t *str, int e)
AXIS2_EXTERN axis2_char_t * | axutil_string_tolower (axis2_char_t *str)
AXIS2_EXTERN axis2_char_t * | axutil_string_toupper (axis2_char_t *str)
AXIS2_EXTERN axis2_char_t * | axutil_strcasestr (const axis2_char_t *heystack, const axis2_char_t *needle)

## Function Documentation

AXIS2_EXTERN axis2_char_t* axutil_strcasestr | ( | const axis2_char_t * | heystack,
|  | const axis2_char_t * | needle |
| ) |  |  |

Finds the first occurrence of the substring needle in the string haystack, ignores the case of both arguments.

Parameters:

  | haystack | string in which the given string is to be found
  | needle | string to be found in haystack

Returns:
  pointer to the beginning of the substring, or NULL if the substring is not found

AXIS2_EXTERN axis2_char_t* axutil_strcat | ( | const axutil_env_t * | env,
|  |  | ... |
| ) |  |  |

Concatenate multiple strings, allocating memory

Parameters:

  | ... | The strings to concatenate. The final string must be NULL

Returns:
  The new string

AXIS2_EXTERN axis2_char_t* axutil_strchr | ( | const axis2_char_t * | s,
|  | axis2_char_t | ch |
| ) |  |  |

Finds the first occurrence of a character in a string

Parameters:

  | s | String in which the character is searched
  | ch | Character to be searched

Returns:
  Pointer to to the first occurence of the charecter if it could be found in the string, NULL otherwise

AXIS2_EXTERN axis2_char_t* axutil_string_replace | ( | axis2_char_t * | str,
|  | axis2_char_t | old_char,
|  | axis2_char_t | new_char |
| ) |  |  |

replace given axis2_character with a new one.

Parameters:

  | str | string operation apply
  | old_char | the old axis2_character which would be replaced
  | new_char | new axis2_char_tacter

Returns:
  replaced string

AXIS2_EXTERN axis2_char_t* axutil_string_substring_ending_at | ( | axis2_char_t * | str,
|  | int | e |
| ) |  |  |

gives a sub string ending with given index.

Parameters:

  | str | string operation apply
  | c | ending index

Returns:
  substring

AXIS2_EXTERN axis2_char_t* axutil_string_substring_starting_at | ( | axis2_char_t * | str,
|  | int | s |
| ) |  |  |

gives a sub string starting with given index.

Parameters:

  | str | string operation apply
  | c | starting index

Returns:
  substring

AXIS2_EXTERN axis2_char_t* axutil_string_tolower | ( | axis2_char_t * | str | ) |

set a string to lowercase.

Parameters:

  | str | string

Returns:
  string with lowercase

AXIS2_EXTERN axis2_char_t* axutil_string_toupper | ( | axis2_char_t * | str | ) |

set a string to uppercase.

Parameters:

  | str | string

Returns:
  string with uppercase

AXIS2_EXTERN void* axutil_strmemdup | ( | const void * | ptr,
|  | size_t | n,
|  | const axutil_env_t * | env |
| ) |  |  |

Create a null-terminated string by making a copy of a sequence of characters and appending a null byte

Parameters:

  | ptr | The block of characters to duplicate
  | n | The number of characters to duplicate

Returns:
  The new string

Remarks:
  This is a faster alternative to axis2_strndup, for use when you know that the string being duplicated really has 'n' or more characters. If the string might contain fewer characters, use axis2_strndup.

AXIS2_EXTERN void* axutil_strndup | ( | const axutil_env_t * | env,
|  | const void * | ptr,
|  | int | n |
| ) |  |  |

duplicate the first n characters of a string into memory allocated the new string will be null-terminated

Parameters:

  | ptr | The string to duplicate
  | n | The number of characters to duplicate

Returns:
  The new string