📝 Text Module
The Text module provides utilities for formatting, cleaning, and analyzing text in a simple and consistent API.
🚀 Quick Example
💻 Code
import allkitpy
print(allkitpy.text.uppercase("hello world"))
✅ Output
HELLO WORLD
✨ Formatting Functions
Converts all characters in a string to uppercase.
💻 Code
import allkitpy
print(
allkitpy.text.uppercase("hello world")
)
✅ Output
HELLO WORLD
Alias of uppercase(). Converts text to uppercase.
💻 Code
import allkitpy
print(allkitpy.text.upper("hello world"))
✅ Output
HELLO WORLD
Converts all characters in a string to lowercase.
💻 Code
import allkitpy
print(allkitpy.text.lowercase("HELLO WORLD"))
✅ Output
hello world
Alias of lowercase(). Converts text to lowercase.
💻 Code
import allkitpy
print(allkitpy.text.lower("HELLO WORLD"))
✅ Output
hello world
Converts text to title case (first letter of each word capitalized).
💻 Code
import allkitpy
print(allkitpy.text.title("hello world from allkitpy"))
✅ Output
Hello World From Allkitpy
Capitalizes only the first character of the string.
💻 Code
import allkitpy
print(allkitpy.text.capitalize("hello world"))
✅ Output
Hello world
Removes all spaces from the text.
💻 Code
import allkitpy
print(allkitpy.text.remove_spaces("hello world from allkitpy"))
✅ Output
helloworldfromallkitpy
Removes extra spaces and keeps only single spacing between words.
💻 Code
import allkitpy
print(allkitpy.text.remove_extra_spaces("hello world from allkitpy"))
✅ Output
hello world from allkitpy
Removes all numeric digits from the text.
💻 Code
import allkitpy
print(allkitpy.text.remove_numbers("a1b2c3d4"))
✅ Output
abcd
Counts the number of words in a string.
💻 Code
import allkitpy
print(allkitpy.text.word_count("hello world from allkitpy"))
✅ Output
4
Counts total characters in the string including spaces.
💻 Code
import allkitpy
print(allkitpy.text.char_count("hello"))
✅ Output
5
Counts number of sentences separated by dots.
💻 Code
import allkitpy
print(allkitpy.text.sentence_count("hello world. this is allkitpy."))
✅ Output
2