(クラス)
A sub-string with dynamically computed size.
説明
default: | Construct sub string instance. |
アクセサ public final inline SafeSubString.for-loop-count:
int
length: | The intended length of the substring. |
アクセサ public abstract SafeSubString.length:
int
アクセサ public final inline SafeSubString.size:
int
start: | Index of the start of the substring. |
アクセサ public abstract SafeSubString.start:
int
public final inline | {SafeSubString.get i:int}:char |
public final | {SafeSubString.substr start:int, length:int}:String |
public final | {SafeSubString.to-String}:String |
メソッド 継承 StringInterface:
compare, equal?, find, find-char-class, find-string, prefix?, replace-clone, split, suffix?, tail, to-double, to-InputStream, to-int, to-int64, to-lower-clone, to-upper-clone, trim-clone, trim-left-clone, trim-right-clone
(ファクトリ)
Construct sub string instance.
説明
Creates a substring of string, with given length and starting at start.
Sets the correspondingly named fields.
(アクセサ)
アクセサ public final inline SafeSubString.for-loop-count:
int Size for use in for loops.
説明
Same as
size. Only for use by
for syntax.
(アクセサ)
アクセサ public abstract SafeSubString.length:
int The intended length of the substring.
説明
This is the length of the substring unless this value plus
start would point past the end of
string.
See
size for details.
(アクセサ)
アクセサ public final inline SafeSubString.size:
int Size of substring.
説明
Returns the lesser of
length and
size of
string minus
start.
Provided the underlying string is not changed in the meantime, accessing characters with positive indexes less than the size should not produce range errors.
(アクセサ)
アクセサ public abstract SafeSubString.start:
int Index of the start of the substring.
説明
The index of the first character in
string belonging to this substring.
(アクセサ)
(メソッド)
この項目はサポートされていません。内部使用限定となっています。
(メソッド)
public final inline | {SafeSubString.get i:int}:char |
self 内の指定された文字を返します。
index: 取得する文字の位置。最左端の文字の位置は 0 です。最右端の文字の位置は (self.size - 1) です。有効値は 0 ~ (self.size - 1) の範囲です (0 と (self.size - 1) を含む)。
例
例 |
|
{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}.}
}
| |
注意事項
(メソッド)
public final | {SafeSubString.substr start:int, length:int}:String |
self の指定された部分文字列を返します。
start: self 内における部分文字列の開始位置。最左端の文字の位置は 0 です。最右端の文字の位置は (self.size - 1) です。有効値は 0 ~ (self.size - 1) の範囲です (0 と (self.size - 1) を含む)。
length: 部分文字列の長さ。つまり、部分文字列内の文字数です。
戻り値
self の指定された部分文字列が格納された
String。この部分文字列は、
start の位置から始まる
length 個の連続した文字です。
注意事項
例
例 |
|
{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}
}
| |
注意事項
クローン作成の詳細については、『Curl 開発者ガイド』の「
文字列クローンの操作」のセクションを参照してください。
(メソッド)
public final | {SafeSubString.to-String}:String |
self と同一 (==) の String を作成します。
戻り値
例
例 |
|
{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}
}
| |