/* * TinyBlocks - tb_string.h * Library tinyblocks-string: blocos de texto (maiusculas/minusculas, trecho, * letra N, contem/comeca/termina, posicao, troca, apara, repete, inverte, * divide em lista, testes de numero/vazio). Ciente de UTF-8: posicoes e * tamanhos contam letras, nao bytes. Registra a categoria "Texto". */ #ifndef TINYBLOCKS_STRING_H #define TINYBLOCKS_STRING_H #include #include #include TB_API const TinyBlocks_LibraryDescriptor* tb_string_get_library(void); /* Funcoes usadas pelos blocos (uteis tambem direto de C). As que devolvem char* alocam com malloc (libere com free). Posicoes comecam em 1. */ TB_API size_t tb_string_length (const char* s); /* em letras */ TB_API char* tb_string_upper (const char* s); TB_API char* tb_string_lower (const char* s); TB_API char* tb_string_sub (const char* s, long long from, long long to); TB_API long long tb_string_find(const char* s, const char* what); /* 0 = nao achou */ TB_API char* tb_string_replace(const char* s, const char* what, const char* with); TB_API char* tb_string_trim (const char* s); TB_API char* tb_string_reverse(const char* s); TB_API bool tb_string_is_number(const char* s); #endif /* TINYBLOCKS_STRING_H */