stringo 1.0.0
stringo: ^1.0.0 copied to clipboard
Zero-dependency Dart string toolkit - case conversion, word splitting, slugify, truncate, mask, and whitespace normalization.
CHANGELOG #
1.0.0 #
Initial release.
stringo is the string toolkit extracted from
dart_helper_utils into a
standalone, zero-dependency package. dart_helper_utils 6.1.0 and later
re-export it, so existing code keeps working without an import change.
Included #
- Case conversion:
toWordsplus 15 case styles (toCamelCase,toPascalCase,toSnakeCase,toKebabCase,toDotCase,toTitleCase,toScreamingSnakeCase,toScreamingKebabCase,toPascalSnakeCase,toPascalKebabCase,toTrainCase,toCamelSnakeCase,toCamelKebabCase,toFlatCase,toScreamingCase),toTitle,capitalizeFirstLetter,lowercaseFirstLetter,capitalizeFirstLowerRest,shouldIgnoreCapitalization,tryToLowerCase,tryToUpperCase. - Transforms:
slugify,truncate,mask,normalizeWhitespace,clean,toOneLine,removeWhiteSpaces,removeEmptyLines,words,lines,nullIfEmpty,nullIfBlank,orEmpty,insert,toCharArray,equalsIgnoreCase,removeSurrounding,replaceBefore,replaceAfter. - Checks:
isBlank/isEmptyOrNull(and negations),isNumeric,isAlphabet,isAlphanumeric,startsWithNumber,containsDigits,hasCapitalLetter,hasMatch, and the six backing regex constants.
Changes from the dart_helper_utils originals #
toTitleCaseandtoTitlenow always capitalize the first word. Previously a leading stop word was lowercased, so'the lord of the rings'.toTitleCaseproduced'the Lord of the Rings'. It now produces'The Lord of the Rings', matching conventional title casing and the behavior the original documentation already described.titleCaseExceptionsis now public and backed by aSetfor constant-time lookup instead of a privateList.maskrejects negativevisibleStart/visibleEndwith anArgumentErrorinstead of failing later with aRangeError.insertis implemented withsubstringrather than aList<String>round-trip. Behavior is unchanged; out-of-range indices still throw aRangeError.- Extension type names dropped the
DHUprefix and are grouped by concern:StringCaseExtensions,NullableStringCaseExtensions,StringTransformExtensions,NullableStringTransformExtensions, andStringChecksExtensions.
Deliberately not included #
Domain validation (isValidEmail, isValidPhoneNumber, isValidUrl,
isValidUsername, isValidCurrency, isUuid, isValidIp4), MIME and file
type checks, parseDuration, and base64 helpers all remain in
dart_helper_utils. Those judge real-world formats rather than transform
text, and their correct behavior varies by project.