Instance Method インスタンスメソッド

stringByTrimmingCharactersInSet:

Returns a new string made by removing from both ends of the receiver characters contained in a given character set. 新しい文字列を返します、レシーバの両端からある与えられた集合に含まれる文字を取り除くことによって作られます。

Declaration 宣言

- (NSString *)stringByTrimmingCharactersInSet:(NSCharacterSet *)set;

Parameters パラメータ

set

A character set containing the characters to remove from the receiver. set must not be nil. レシーバから取り除くことになる文字を含んでいる文字集合。setnilであってはいけません。

Return Value 戻り値

A new string made by removing from both ends of the receiver characters contained in set. If the receiver is composed entirely of characters from set, the empty string is returned. 新しい文字列、レシーバの両端からsetに含まれる文字を取り除くことによって作られます。レシーバが完全にsetからの文字で構成されるならば、空の文字列が返されます。

Discussion 議論

Use whitespaceCharacterSet or whitespaceAndNewlineCharacterSet to remove whitespace around strings. whitespaceCharacterSetまたはwhitespaceAndNewlineCharacterSet使って、文字列を取り巻く空白を取り除きます。

See Also 参照

Dividing Strings 文字列を分割する