TextUtils
Wisej.Base.TextUtils
Last updated
Wisej.Base.TextUtils
Last updated
Namespace: Wisej.Base
Assembly: Wisej.Framework (3.2.0.0)
Provides utility methods to measure, encode, and extract mnemonics from text.
Name | Type | Description |
---|---|---|
Escapes special characters in the specified string.
Parameter | Type | Description |
---|---|---|
Returns: String. The escaped string. Null if the specified string was null, or empty if it was empty.
Removes the ampersand from the text and encodes HTML characters if necessary.
Returns: String. The escaped string. Null if the specified string was null, or empty if it was empty.
Returns the first character that is preceded by an ampersand (&).
Returns: String.
Returns the size of the specified text when rendered with the specified font.
Returns: Size. The computed Size of the specified text.
Returns the size of the specified text when rendered with the specified font.
Returns: Size. The computed Size of the specified text.
Returns the size of the specified text when rendered with the specified font.
Returns: Size.
Returns the size of the specified text when rendered with the specified font.
Returns: Size.
Returns the size of the specified text when rendered with the specified font.
Returns the size of the specified text when rendered with the specified font.
Asynchronously returns the size of the specified text when rendered with the specified font. The measurement is performed on the browser. Returns an awaitable Task that contains the measured size.
Returns: Task<Size>. An awaitable Task that represents the asynchronous operation.
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
text
The text to convert.
allowHtml
Whether to encode HTML characters.
useMnemonic
Whether to convert the first mnemonic to an underlined character.
translateNewLines
Whether to convert newlines (CRLF) to <BR/>. The conversion is performed only when allowHtml is false, or, if allowHtml is true and the text doesn't contain any HTML.
text
The string from which to extract the mnemonic character.
text
The text to measure.
font
The Font to apply to the measured text.
text
The text to measure.
font
The Font to apply to the measured text.
format
Formatting information.
text
The text to measure.
font
The Font to apply to the measured text.
layoutArea
The Size to use as bounding rectangle for the text.
text
The text to measure.
font
The Font to apply to the measured text.
layoutArea
The Size to use as bounding rectangle for the text.
format
Formatting information.
text
The text to measure.
allowHtml
The text to measure may contain HTML tags.
font
The Font to apply to the measured text.
callback
Result callback method, invoked when the client has finished measuring the text.
text
The text to measure.
allowHtml
The text to measure may contain HTML tags.
font
The Font to apply to the measured text.
width
The width to use as bounding rectangle for the text.
callback
Result callback method, invoked when the client has finished measuring the text.
text
The text to measure.
allowHtml
The text to measure may contain HTML tags.
font
The Font to apply to the measured text.
The optional width to use as bounding rectangle for the text.
ConvertToString
Pluggable method used to convert user input to a string. Since 3.0.10
MeasureString
Pluggable method used to measure strings.
text
The text to escape.
Indicates that HTML tags should not be escaped. The default is false.
width
allowHtml