String class¶
This page explains the String
class.
Before reading on, maybe it is helpful to read the following page:
What is the String class?¶
The String
class is the apysc string class. It can accept str
or String
values at the constructor, as follows:
import apysc as ap
ap.Stage()
string_1: ap.String = ap.String("Hello")
assert string_1 == "Hello"
string_2: ap.String = ap.String(string_1)
assert string_2 == "Hello"
String class interfaces¶
For more details about the String
class each interface, please see the following:
String class constructor API¶
Note: the document build script generates and updates this API document section automatically. Maybe this section is duplicated compared with previous sections.
[Interface signature] __init__(self, value: Union[str, ForwardRef('String')], *, variable_name_suffix: str = '', skip_init_substitution_expression_appending: bool = False) -> None
[Interface summary]
String class for apysc library.
[Parameters]
value
: String or strInitial string value.
variable_name_suffix
: str, default “”A JavaScript variable name suffix string. This setting is sometimes useful for JavaScript debugging.
skip_init_substitution_expression_appending
: bool, default FalseA boolean indicates whether to skip an initial substitution expression or not. This class uses this option internally.
[Notes]
The Str
class is the alias of String
.
[Examples]
>>> import apysc as ap
>>> _ = ap.Stage()
>>> string: ap.String = ap.String("Hello")
>>> string
String("Hello")
>>> string += " World!"
>>> string
String("Hello World!")
[References]
value property API¶
Note: the document build script generates and updates this API document section automatically. Maybe this section is duplicated compared with previous sections.
[Interface summary]
Get a current string value.
[Returns]
value
: strCurrent string value.
[Examples]
>>> import apysc as ap
>>> _ = ap.Stage()
>>> string: ap.String = ap.String("Hello")
>>> string.value = "World!"
>>> string.value
'World!'
[References]