语言

IPath.EndsWith 方法

定义

重载

名称 说明
EndsWith(IPath)

测试此路径是否以给定路径结尾。

EndsWith(String)

测试此路径是否以完全由方法指定的Path方式转换给定路径字符串来构造的 a#endsWith(Path) endsWith(Path)。

EndsWith(IPath)

测试此路径是否以给定路径结尾。

[Android.Runtime.Register("endsWith", "(Ljava/nio/file/Path;)Z", "GetEndsWith_Ljava_nio_file_Path_Handler:Java.Nio.FileNio.IPathInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=26)]
public bool EndsWith(Java.Nio.FileNio.IPath? other);
[<Android.Runtime.Register("endsWith", "(Ljava/nio/file/Path;)Z", "GetEndsWith_Ljava_nio_file_Path_Handler:Java.Nio.FileNio.IPathInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=26)>]
abstract member EndsWith : Java.Nio.FileNio.IPath -> bool

参数

other
IPath

给定路径

返回

true 如果此路径以给定路径结尾,则为 ;否则 false

特性

注解

测试此路径是否以给定路径结尾。

如果给定路径具有 N 个元素,并且没有根组件,并且此路径具有 N 个或更多元素,则如果每个路径的最后 N 个元素(从根最远的元素开始)相等,则此路径以给定路径结尾。

如果给定路径具有根组件,则如果此路径的根组件以给定路径的根组件结尾,则此路径的根组件以给定路径的根组件 结尾 ,并且这两个路径的相应元素相等。 此路径的根组件是否以给定路径的根组件结尾是特定于文件系统的。 如果此路径没有根组件,并且给定路径具有根组件,则此路径不会以给定路径结尾。

如果给定路径与此路径不同 FileSystem ,则 false 返回该路径。

Java文档java.nio.file.Path.endsWith(java.nio.file.Path)。

本页的某些部分是根据 Android 开放源代码项目创建和共享的工作进行的修改,并根据 Creative Commons 2.5 属性许可证中所述的术语使用。

适用于

EndsWith(String)

测试此路径是否以完全由方法指定的Path方式转换给定路径字符串来构造的 a#endsWith(Path) endsWith(Path)。

[Android.Runtime.Register("endsWith", "(Ljava/lang/String;)Z", "GetEndsWith_Ljava_lang_String_Handler:Java.Nio.FileNio.IPathInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=26)]
public bool EndsWith(string? other);
[<Android.Runtime.Register("endsWith", "(Ljava/lang/String;)Z", "GetEndsWith_Ljava_lang_String_Handler:Java.Nio.FileNio.IPathInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=26)>]
abstract member EndsWith : string -> bool

参数

other
String

给定的路径字符串

返回

true 如果此路径以给定路径结尾,则为 ;否则 false

特性

注解

测试此路径是否以完全由方法指定的Path方式转换给定路径字符串来构造的 a#endsWith(Path) endsWith(Path)。 例如,在 UNIX 上,路径“foo/bar”以“foo/bar”和“bar”结尾。 它不以“r”或“”/bar结尾。 请注意,不考虑尾随分隔符,因此在返回“truebar/”的“foo/bar”String上调用此方法Path。

Java文档java.nio.file.Path.endsWith(java.lang.String)。

本页的某些部分是根据 Android 开放源代码项目创建和共享的工作进行的修改,并根据 Creative Commons 2.5 属性许可证中所述的术语使用。

适用于