---
title: "CFStringSetExternalCharactersNoCopy(_:_:_:_:)"
framework: corefoundation
role: symbol
role_heading: Function
path: "corefoundation/cfstringsetexternalcharactersnocopy(_:_:_:_:)"
---

# CFStringSetExternalCharactersNoCopy(_:_:_:_:)

Notifies a CFMutableString object that its external backing store of Unicode characters has changed.

## Declaration

```swift
func CFStringSetExternalCharactersNoCopy(_ theString: CFMutableString!, _ chars: UnsafeMutablePointer<UniChar>!, _ length: CFIndex, _ capacity: CFIndex)
```

## Parameters

- `theString`: The string to act as a “wrapper” for the external backing store (chars). If this value is not a CFMutableString object, an assertion is raised.
- `chars`: The external (client-owned) Unicode buffer acting as the backing store for theString.
- `length`: The current length of the contents of chars (in Unicode characters).
- `capacity`: The capacity of the Unicode buffer—that is, the total number of Unicode characters that can be stored in it before the buffer has to be grown.

## Discussion

Discussion You use this function to reallocate memory for a string, if necessary, and change its references to the data in the buffer. The object must have been created with the CFStringCreateMutableWithExternalCharactersNoCopy(_:_:_:_:_:) function; see the discussion of this function for more information.

## See Also

### CFMutableString Miscellaneous Functions

- [CFStringAppend(_:_:)](corefoundation/cfstringappend(_:_:).md)
- [CFStringAppendCharacters(_:_:_:)](corefoundation/cfstringappendcharacters(_:_:_:).md)
- [CFStringAppendCString(_:_:_:)](corefoundation/cfstringappendcstring(_:_:_:).md)
- [CFStringAppendFormatAndArguments(_:_:_:_:)](corefoundation/cfstringappendformatandarguments(_:_:_:_:).md)
- [CFStringAppendPascalString(_:_:_:)](corefoundation/cfstringappendpascalstring(_:_:_:).md)
- [CFStringCapitalize(_:_:)](corefoundation/cfstringcapitalize(_:_:).md)
- [CFStringCreateMutable(_:_:)](corefoundation/cfstringcreatemutable(_:_:).md)
- [CFStringCreateMutableCopy(_:_:_:)](corefoundation/cfstringcreatemutablecopy(_:_:_:).md)
- [CFStringCreateMutableWithExternalCharactersNoCopy(_:_:_:_:_:)](corefoundation/cfstringcreatemutablewithexternalcharactersnocopy(_:_:_:_:_:).md)
- [CFStringDelete(_:_:)](corefoundation/cfstringdelete(_:_:).md)
- [CFStringFindAndReplace(_:_:_:_:_:)](corefoundation/cfstringfindandreplace(_:_:_:_:_:).md)
- [CFStringFold(_:_:_:)](corefoundation/cfstringfold(_:_:_:).md)
- [CFStringInsert(_:_:_:)](corefoundation/cfstringinsert(_:_:_:).md)
- [CFStringLowercase(_:_:)](corefoundation/cfstringlowercase(_:_:).md)
- [CFStringNormalize(_:_:)](corefoundation/cfstringnormalize(_:_:).md)
