説明
SubString を初期化します。 |
部分文字列の長さ。 |
部分文字列の基になる表現。 |
self 内の文字数。 |
元の表現内での部分文字列の開始位置を示します。 |
self 内の指定された文字を返します。 |
self の指定された部分文字列を返します。 |
self と同一 (==) の |
SubString を初期化します。
注意事項
self 内の文字数。
戻り値
説明
例
例 | |
{value || Declare and initialize a read-only string let s:String = "Hello World!" || Output a message that includes the return value of || a call to "size". || Note that you must use "value" to display the value || of "s.size", rather than the text "s.size". {text There are {value s.size} characters in the string.} } |
例 | |
{value || Declare and initialize a writable string. let sb:StringBuf = {StringBuf "Hello World!"} || Set the size of the string to 5 characters. || The string should now contain only the first five || characters, "Hello". set sb.size = 5 || Output a message that includes the new string {text If {monospace size} is set to 5, the string becomes: {value sb}} } |
例 | |
{value || Declare and initialize a writable string. let sb:StringBuf = {StringBuf "Hello World!"} || Set the size of the string to 20 characters. || The string should now have 8 characters || with the Unicode value 0000 at the end. set sb.size = 20 || Output a message that includes the new string. {text Then, if {monospace size} is set to 20, the string becomes: {value sb}} } |
注意事項
self 内の指定された文字を返します。
例外のスロー
index が範囲外の場合は例
例 | |
{value || Declare and initialize a string. let s:String = "Hello World!" || Display the string and return the || character at position 7. || Remember that the leftmost position || is 0 (zero). {text {value s} {br}The character at position 7 is {s.get 7}.} } |
注意事項
self の指定された部分文字列を返します。
戻り値
注意事項
例
例 | |
{value || Declare and initialize s1 (the original string). let s1:String = "Hello World!" || Initialize s2 with a substring of s1. The || substring begins at position 6 and is 5 || characters long ("World"). || Remember that the leftmost position || is 0 (zero). let s2:String = {s1.substr 6, 5} || Display the contents of s2. {value s2} } |
注意事項
self と同一 (==) の
戻り値
例
例 | |
{value || Define and initialize a StringBuf. let sb:StringBuf = {StringBuf "Hello World!"} || Convert the StringBuf to a String. let s:String = {sb.to-String} || Display the contents of the String. {value s} } |