---
title: "applyTransform(_:reverse:range:updatedRange:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/nsmutablestring/applytransform(_:reverse:range:updatedrange:)"
---

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

Transliterates the receiver by applying a specified ICU string transform.

## Declaration

```swift
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 doc://com.apple.foundation/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

Return Value true if the transform was successfully applied. Otherwise, false.

## Discussion

Discussion In addition to the provided transformation constants, you may use any valid ICU transform ID as defined in the ICU User Guide. However, arbitrary ICU transform rules are not supported.

## See Also

### Modifying a String

- [append(_:)](foundation/nsmutablestring/append(_:).md)
- [deleteCharacters(in:)](foundation/nsmutablestring/deletecharacters(in:).md)
- [insert(_:at:)](foundation/nsmutablestring/insert(_:at:).md)
- [replaceCharacters(in:with:)](foundation/nsmutablestring/replacecharacters(in:with:).md)
- [replaceOccurrences(of:with:options:range:)](foundation/nsmutablestring/replaceoccurrences(of:with:options:range:).md)
- [setString(_:)](foundation/nsmutablestring/setstring(_:).md)
