DHUBidiStringExtensions extension
Provides extensions for String to support bidirectional text handling and manipulation.
- on
Methods
-
detectRtlDirectionality(
{bool isHtml = false}) → bool -
Available on String, provided by the DHUBidiStringExtensions extension
Detects the predominant text directionality in the string, optionally considering HTML markup. -
endsWithLtr(
[bool isHtml = false]) → bool -
Available on String, provided by the DHUBidiStringExtensions extension
Checks if the string ends with left-to-right (LTR) text, optionally considering HTML markup. -
endsWithRtl(
[bool isHtml = false]) → bool -
Available on String, provided by the DHUBidiStringExtensions extension
Checks if the string ends with right-to-left (RTL) text, optionally considering HTML markup. -
enforceLtr(
) → String -
Available on String, provided by the DHUBidiStringExtensions extension
Enforces left-to-right (LTR) directionality in plain text. -
enforceLtrInHtml(
) → String -
Available on String, provided by the DHUBidiStringExtensions extension
Enforces left-to-right (LTR) directionality in HTML markup. -
enforceRtlIn(
) → String -
Available on String, provided by the DHUBidiStringExtensions extension
Enforces right-to-left (RTL) directionality in plain text. -
enforceRtlInHtml(
) → String -
Available on String, provided by the DHUBidiStringExtensions extension
Enforces right-to-left (RTL) directionality in HTML markup. -
guardBracket(
[bool? isRtlContext]) → String -
Available on String, provided by the DHUBidiStringExtensions extension
Guards brackets in plain text to maintain bidirectional text support. -
guardBracketInHtml(
[bool? isRtlContext]) → String -
Available on String, provided by the DHUBidiStringExtensions extension
Guards brackets in HTML markup to maintain bidirectional text support. -
guessDirection(
{bool isHtml = false}) → TextDirection -
Available on String, provided by the DHUBidiStringExtensions extension
Guesses the text directionality based on its content, optionally considering HTML markup. -
hasAnyLtr(
[bool isHtml = false]) → bool -
Available on String, provided by the DHUBidiStringExtensions extension
Checks if the string contains any left-to-right (LTR) characters, optionally considering HTML markup. -
hasAnyRtl(
[bool isHtml = false]) → bool -
Available on String, provided by the DHUBidiStringExtensions extension
Checks if the string contains any right-to-left (RTL) characters, optionally considering HTML markup. -
isRtlLanguage(
[String? languageString]) → bool -
Available on String, provided by the DHUBidiStringExtensions extension
Checks if the string represents a right-to-left (RTL) language text. -
startsWithLtr(
[bool isHtml = false]) → bool -
Available on String, provided by the DHUBidiStringExtensions extension
Checks if the string starts with left-to-right (LTR) text, optionally considering HTML markup. -
startsWithRtl(
[bool isHtml = false]) → bool -
Available on String, provided by the DHUBidiStringExtensions extension
Checks if the string starts with right-to-left (RTL) text, optionally considering HTML markup. -
stripHtmlIfNeeded(
) → String -
Available on String, provided by the DHUBidiStringExtensions extension
Strips HTML tags from the string if needed, preserving bidirectional text direction. -
wrapWithSpan(
{TextDirection textDirection = textDirectionUNKNOWN, bool isHtml = false, bool resetDir = true}) → String -
Available on String, provided by the DHUBidiStringExtensions extension
Wraps the text with aspantag and sets the direction attribute (dir) based on the provided or estimated direction. -
wrapWithUnicode(
{TextDirection textDirection = textDirectionUNKNOWN, bool isHtml = false, bool resetDir = true}) → String -
Available on String, provided by the DHUBidiStringExtensions extension
Wraps the text with unicode BiDi formatting characters based on the provided or estimated direction.