opt: string ext

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-03-02 12:04:13 +08:00
parent c32b98fa7f
commit 3abff4b9da

View File

@@ -55,11 +55,8 @@ extension ListExt<T> on List<T>? {
final _regExp = RegExp("^(http:)?//", caseSensitive: false); final _regExp = RegExp("^(http:)?//", caseSensitive: false);
extension StringExt on String? { extension StringExt on String? {
String get http2https => String get http2https => this?.replaceFirst(_regExp, "https://") ?? '';
this == null ? '' : this!.replaceFirst(_regExp, "https://");
}
extension StringNullExt on String? {
bool get isNullOrEmpty => this == null || this!.isEmpty; bool get isNullOrEmpty => this == null || this!.isEmpty;
} }