This library provides a set of functions for manipulating multibyte strings in C. It includes functions for calculating string lengths, comparing strings, copying and concatenating strings, and searching for characters within strings.
- git clone https://github.com/kaan-yalcinkaya/MBString
- cd MBString
- cmake -B build -D CMAKE_BUILD_TYPE=Release
- cmake --build build
Include the multibyte_string.h header file in your source code:
#include "multibyte_string.h"
You can then use the provided functions to manipulate multibyte strings in your application.
size_t mbslen(const char* mbs)
Calculates the length of a multibyte string.
size_t mbsnlen(const char* mbs, size_t n)
Calculates the length of a multibyte string up to a specified limit.
int mbsncmp(char* mbs1, char* mbs2, size_t n)
Compares two multibyte strings up to a specified number of characters.
char* mbsncpy(char* dest, size_t cbDest, const char* src, size_t n)
Copies up to a specified number of characters from one multibyte string to another.
char* mbsncat(char* dest, size_t cbDest, const char* src, size_t n)
Concatenates up to a specified number of characters from one multibyte string to another.
char* mbschr16(char* mbs, char16_t c)
Locates the first occurrence of a 16-bit character in a multibyte string.
char* mbschr32(char* mbs, char32_t c)
Locates the first occurrence of a 32-bit character in a multibyte string.
char* mbsrchr16(char* mbs, char16_t c)
Locates the last occurrence of a 16-bit character in a multibyte string.
char* mbsrchr32(char* mbs, char32_t c)
Locates the last occurrence of a 32-bit character in a multibyte string.
char* mbspbrk(char* mbs1, char* mbs2)
Locates the first occurrence in a multibyte string of any of the characters in another string.
size_t mbsspn(char* mbs1, char* mbs2)
Calculates the length of the initial segment of a multibyte string consisting of characters not in another string.