StringWidth Method
StringWidth(String)
When implemented by a class, returns width of the given string.
Declaration
int StringWidth(string text)
Parameters
Type | Name | Description |
---|---|---|
String | text | The text to calculate width. |
Returns
Type | Description |
---|---|
Int32 | Width of specified string. |
StringWidth(String, Int32, Int32)
When implemented by a class, returns width of the specified part of the given string.
Declaration
int StringWidth(string text, int pos, int len)
Parameters
Type | Name | Description |
---|---|---|
String | text | The text to calculate width. |
Int32 | pos | Position of the first character to start calculating. |
Int32 | len | Length of the part of string to calculate width. |
Returns
Type | Description |
---|---|
Int32 | Width of the part of string. |
StringWidth(String, Int32, out Int32, Boolean)
When implemented by a class, returns width of the given string fitting into the given Width.
Declaration
int StringWidth(string text, int width, out int count, bool exact)
Parameters
Type | Name | Description |
---|---|---|
String | text | The text to calculate width. |
Int32 | width | Maximum layout area for the string. |
Int32 | count | Receives number of character fitting into specified Width. |
Boolean | exact | Specifies whether the calculating should be precise. |
Returns
Type | Description |
---|---|
Int32 | Width of the part of string. |
StringWidth(String, Int32, Int32, Int32, out Int32)
When implemented by a class, returns width of the specified part of the given string fitting into the given Width.
Declaration
int StringWidth(string text, int pos, int len, int width, out int count)
Parameters
Type | Name | Description |
---|---|---|
String | text | The text to calculate width. |
Int32 | pos | Position of the first character to start calculating. |
Int32 | len | Length of the part of string to calculate width. |
Int32 | width | Maximum layout area for the string. |
Int32 | count | Receives number of characters fitting into specified Width. |
Returns
Type | Description |
---|---|
Int32 | Width of the part of string. |
StringWidth(String, Int32, Int32, Int32, out Int32, Boolean)
When implemented by a class, returns width of the specified part of the given string fitting into the given Width.
Declaration
int StringWidth(string text, int pos, int len, int width, out int count, bool exact)
Parameters
Type | Name | Description |
---|---|---|
String | text | The text to calculate width. |
Int32 | pos | Position of the first character to start calculating. |
Int32 | len | Length of the part of string to calculate width. |
Int32 | width | Maximum layout area for the string. |
Int32 | count | Receives number of characters fitting into the into the specified Width. |
Boolean | exact | Specifies whether the calculating should be precise. |
Returns
Type | Description |
---|---|
Int32 | Width of the part of string. |