2021-10-13 21:43:45 +02:00
|
|
|
#ifndef __STRING__
|
|
|
|
#define __STRING__
|
2021-09-29 22:34:22 +02:00
|
|
|
|
2023-08-10 11:13:06 +02:00
|
|
|
#include <errno.h>
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Return the length of a string (excluding '\0').
|
|
|
|
*
|
|
|
|
* @param string
|
|
|
|
*/
|
|
|
|
size_t string_get_length(const char* string);
|
|
|
|
|
2021-09-29 22:34:22 +02:00
|
|
|
/**
|
|
|
|
* @brief Converts all the alphabetic characters in a string to uppercase.
|
|
|
|
*
|
2023-08-10 11:13:06 +02:00
|
|
|
* NOTE: Mutates the string.
|
|
|
|
*
|
2021-09-29 22:34:22 +02:00
|
|
|
* @param string
|
|
|
|
*/
|
2023-08-10 11:13:06 +02:00
|
|
|
void string_to_uppercase(char* string);
|
2021-09-29 22:34:22 +02:00
|
|
|
|
|
|
|
/**
|
2023-08-10 11:13:06 +02:00
|
|
|
* @brief Removes all the occurrences of a character in a string.
|
|
|
|
*
|
|
|
|
* NOTE: Mutates the string.
|
2021-09-29 22:34:22 +02:00
|
|
|
*
|
|
|
|
* @param string
|
2023-08-10 11:13:06 +02:00
|
|
|
* @param search A character search value.
|
2021-09-29 22:34:22 +02:00
|
|
|
*/
|
2023-08-10 11:13:06 +02:00
|
|
|
void string_remove_character(char* string, char search);
|
2021-09-29 22:34:22 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Converts a string to its acronym.
|
|
|
|
*
|
|
|
|
* @param string
|
|
|
|
* @return char*
|
|
|
|
*/
|
|
|
|
char* string_acronym(char* string);
|
|
|
|
|
|
|
|
#endif
|