<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSMutableString/applyTransform(_:reverse:range:updatedRange:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSMutableString(im)applyTransform:reverse:range:updatedRange:"
  },
  "title" : "applyTransform(_:reverse:range:updatedRange:)"
}
-->

# applyTransform(_:reverse:range:updatedRange:)

Transliterates the receiver by applying a specified ICU string transform.

```
func applyTransform(_ transform: StringTransform, reverse: Bool, range: NSRange, updatedRange resultingRange: NSRangePointer?) -> Bool
```

## Parameters

`transform`

The transformation to apply. For a list of possible values, see [String Transformations](/documentation/Foundation/string-transformations). If the specified transform does not exist, the receiver is not modified, and this method returns <doc://com.apple.documentation/documentation/Swift/false>.

`reverse`

Whether an inverse transform should be used. If the specified transform does not have an inverse, the receiver is not modified, and this method returns <doc://com.apple.documentation/documentation/Swift/false>.

`range`

The range of the string to transform. `range` must not exceed the bounds of the receiver.
  
  > Important:
  > Raises an `NSRangeException` if any part of `aRange` lies beyond the end of the string.

`resultingRange`

If the transform was successfully applied, upon return contains the range of the transformed string.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if the transform was successfully applied. Otherwise, <doc://com.apple.documentation/documentation/Swift/false>.

## Discussion

In addition to the provided transformation constants, you may use any valid ICU transform ID as defined in the [ICU User Guide](http://userguide.icu-project.org/transforms/general). However, arbitrary ICU transform rules are not supported.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)