path(withComponents:)
Returns a string built from the strings in a given array by concatenating them with a path separator between each pair.
Declaration
class func path(withComponents components: [String]) -> StringParameters
- components:
An array of
NSStringobjects representing a file path. To create an absolute path, use a slash mark (”/”) as the first component. To include a trailing path divider, use an empty string as the last component.
Return Value
A string built from the strings in components by concatenating them (in the order they appear in the array) with a path separator between each pair.
Discussion
This method doesn’t clean up the path created; use standardizingPath to resolve empty components, references to the parent directory, and so on.
See Also
Working with Paths
pathComponentscompletePath(into:caseSensitive:matchesInto:filterTypes:)fileSystemRepresentationgetFileSystemRepresentation(_:maxLength:)isAbsolutePathlastPathComponentpathExtensionabbreviatingWithTildeInPathappendingPathComponent(_:)appendingPathExtension(_:)deletingLastPathComponentdeletingPathExtensionexpandingTildeInPathresolvingSymlinksInPathstandardizingPath