文字 (
注意事項
プログラミング注意事項
注意事項
注意事項
| self の efficient-size を取得または設定します。 |
| 文字列に対して繰り返し処理を実行するコンテナである |
| 特定のインスタンスまたはサブクラスが フラグをサポートし、 |
| ダミー アクセッサ。 |
| このストリームを開いた |
| self 内の文字数。 |
| バッファ内のフラッシュされていないデータ量を示します。 |
| 最大バッファ サイズを示します。 |
| 文字を self の末尾に追加します。 |
| self をクリアします。 |
| ダミー メソッド。 |
| self と、指定された |
| ダミー メソッド。 |
| self 内の指定された文字を返します。 |
| 文字を self に挿入します。 |
| 指定された文字を self から削除します。 |
| self 内の文字の順序を逆にします。 |
| self 内の文字を置換します。 |
| self の指定された部分文字列を返します。 |
| self と同一 (==) の |
| 文字を self の末尾に追加します。 |
注意事項
self の efficient-size を取得または設定します。
説明
文字列に対して繰り返し処理を実行するコンテナである
注意事項
特定のインスタンスまたはサブクラスが フラグをサポートし、
注意事項
ダミー アクセッサ。
説明
このストリームを開いた
例
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 の末尾に追加します。
説明
例
| 例 | |
{value
|| Declare and initialize a StringBuf.
let sb:StringBuf = {StringBuf "Hello World!"}
|| Append an exclamation mark (!).
{sb.append '!'}
|| Display the resulting StringBuf.
{value sb}
}
|
self をクリアします。
説明
例
| 例 | |
{value
|| Declare and initialize a StringBuf.
let sb:StringBuf = {StringBuf "Hello World!"}
|| Clear the StringBuf.
{sb.clear}
|| Check if the StringBuf is empty.
{text The assertion that the string is empty
is... {value sb.empty?}}
}
|
ダミー メソッド。
説明
注意事項
説明
例
| 例 | |
{value
|| Declare and initialize two StringBufs.
let sb1:StringBuf = {StringBuf "Hello World!"}
let sb2:StringBuf = {StringBuf " Can you hear me?"}
|| Concatenate "sb2" onto "sb1".
{sb1.concat sb2}
|| Display the resulting StringBuf.
{value sb1}
}
|
self と、指定された
戻り値
例
| 例 | |
![]() | |
{value
|| Declare and initialize two strings
let s1:String = "Hello World!"
let s2:String = "hello world!"
|| Display the strings.
{text
String 1: {value s1}
{br}String 2: {value s2}
|| Test if the two strings are equal and display
|| an appropriate message.
{if {s1.equal? s2} then
{text The strings are equal.}
else
{text The strings are NOT equal.}
}
|| Test if the two strings are equal, this time
|| ignoring case, and display an appropriate message.
But, if you ignore case,
{if {s1.equal? s2, ignore-case? = true} then
{text they are equal.}
else
{text they are NOT equal.}
}
}
}
|
ダミー メソッド。
説明
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 a StringBuf.
let sb:StringBuf = {StringBuf "Hello World!"}
|| Insert a comma (,) at position 5.
|| Remember that the leftmost position
|| is 0 (zero).
{sb.insert ',', 5}
|| Display the resulting StringBuf.
{value sb}
}
|
注意事項
指定された文字を self から削除します。
説明
例
| 例 | |
{value
|| Declare and initialize a StringBuf.
let sb:StringBuf = {StringBuf "Hello World!"}
|| Remove 6 characters, starting at
|| position 5.
|| Remember that the leftmost position
|| is 0 (zero).
{sb.remove 5, length = 6}
|| Display the resulting StringBuf.
{value sb}
}
|
注意事項
self 内の文字の順序を逆にします。
例
| 例 | |
{value
|| Declare and initialize a StringBuf
let sb:StringBuf = {StringBuf "Hello World!"}
|| Reverses the order of the characters
{sb.reverse}
|| Display the resulting StringBuf
{value sb}
}
|
注意事項
self 内の文字を置換します。
説明
例
| 例 | |
{value
|| Declare and initialize a StringBuf.
let sb:StringBuf = {StringBuf "Hello World!"}
|| Replace character 11 (!) with a period (.).
|| Remember that the leftmost position
|| is 0 (zero).
{sb.set 11, '.'}
|| Display the resulting StringBuf.
{value sb}
}
|
注意事項
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}
}
|
文字を self の末尾に追加します。
説明
例
| 例 | |
{value
|| Declare and initialize a StringBuf
let sb:StringBuf = {StringBuf "Hello World!"}
|| Append an exclamation mark (!)
{sb.write-one '!'}
|| Display the resulting StringBuf
{value sb}
}
|
戻り値
注意事項
例
| 例 | |
{value
|| Declare and initialize two StringBufs.
let sb1:StringBuf = {StringBuf "Hello World!"}
let sb2:StringBuf = {StringBuf " Can you hear me?"}
|| Declare a variable to hold the return
|| value from the method call.
let i:int
|| Write "sb2" onto "sb1"
set i = {sb1.write-one-string sb2}
|| Display a message indicating the resulting
|| StringBuf.
{text {value i} characters were added to create the string:
{br}{value sb1}}
}
|