Instance Property インスタンスプロパティ

stringByDeletingPathExtension

A new string made by deleting the extension (if any, and only the last) from the receiver. 拡張子を(もしあれば、そして最後のものだけ)レシーバから削除する事によって作られる新しい文字列。

Declaration 宣言

@property(readonly, copy) NSString *stringByDeletingPathExtension;

Discussion 議論

A new string made by deleting the extension (if any, and only the last) from the receiver. Strips any trailing path separator before checking for an extension. If the receiver represents the root path, it is returned unaltered. 拡張子を(もしあれば、そして最後のものだけ)レシーバから削除する事によって作られる新しい文字列。後に引きずっているあらゆるパス分離子を剝ぎ取ります、拡張子を確認する前にです。レシーバがルートパスを表すならば、それは変更なしで返されます。

The following table illustrates the effect of this method on a variety of different paths: 以下の表は、このメソッドの効果を様々な異なるパスに関して解説します:

Receiver’s String Value レシーバのもつ文字列値

Resulting String 結果文字列

/tmp/scratch.tiff

/tmp/scratch

/tmp/

/tmp

scratch.bundle/

scratch

scratch..tiff

scratch.

.tiff

.tiff

/

/

Note that attempting to delete an extension from @".tiff" causes the result to be @".tiff" instead of an empty string. This difference is because a file named @".tiff" is not considered to have an extension, so nothing is deleted. Note also that this method only works with file paths (not, for example, string representations of URLs). 拡張子を@".tiff"から削除する試みは@".tiff"という結果を引き起こします、空の文字列の代わりに。この違いは、@".tiff"という名前のファイルは拡張子を持つとは考えられないからです、それで何も削除されません。またこのメソッドはファイルパスでのみ働くことにも注意してください(例えば、URLの文字列表現ではなく)。

See Also 参照

Working with Paths パスを扱う