---
title: "CFStringInitInlineBuffer(_:_:_:)"
framework: corefoundation
role: symbol
role_heading: Function
path: "corefoundation/cfstringinitinlinebuffer(_:_:_:)"
---

# CFStringInitInlineBuffer(_:_:_:)

Initializes an in-line buffer to use for efficient access of a CFString object’s characters.

## Declaration

```swift
func CFStringInitInlineBuffer(_ str: CFString!, _ buf: UnsafeMutablePointer<CFStringInlineBuffer>!, _ range: CFRange)
```

## Parameters

- `str`: The string to copy to the in-line buffer.
- `buf`: The (uninitialized) doc://com.apple.corefoundation/documentation/CoreFoundation/CFStringInlineBuffer structure to initialize. On return, an initialized structure that can be used in a doc://com.apple.corefoundation/documentation/CoreFoundation/CFStringGetCharacterFromInlineBuffer(_:_:) function call. Typically this buffer is allocated on the stack.
- `range`: The range of characters in str to copy to buf. The specified range must not exceed the length of the string.

## Discussion

Discussion This function initializes an CFStringInlineBuffer structure that can be used for accessing the characters of a string. Once the buffer is initialized you can call the CFStringGetCharacterFromInlineBuffer(_:_:) function to access the characters in the buffer one at a time. The in-line buffer functions, along with the CFStringInlineBuffer structure, give you fast access to the characters of a string. The technique for in-line buffer access combines the convenience of one-at-a-time character access with the efficiency of bulk access.

## See Also

### Accessing Characters

- [CFStringCreateExternalRepresentation(_:_:_:_:)](corefoundation/cfstringcreateexternalrepresentation(_:_:_:_:).md)
- [CFStringGetBytes(_:_:_:_:_:_:_:_:)](corefoundation/cfstringgetbytes(_:_:_:_:_:_:_:_:).md)
- [CFStringGetCharacterAtIndex(_:_:)](corefoundation/cfstringgetcharacteratindex(_:_:).md)
- [CFStringGetCharacters(_:_:_:)](corefoundation/cfstringgetcharacters(_:_:_:).md)
- [CFStringGetCharactersPtr(_:)](corefoundation/cfstringgetcharactersptr(_:).md)
- [CFStringGetCharacterFromInlineBuffer(_:_:)](corefoundation/cfstringgetcharacterfrominlinebuffer(_:_:).md)
- [CFStringGetCString(_:_:_:_:)](corefoundation/cfstringgetcstring(_:_:_:_:).md)
- [CFStringGetCStringPtr(_:_:)](corefoundation/cfstringgetcstringptr(_:_:).md)
- [CFStringGetLength(_:)](corefoundation/cfstringgetlength(_:).md)
- [CFStringGetPascalString(_:_:_:_:)](corefoundation/cfstringgetpascalstring(_:_:_:_:).md)
- [CFStringGetPascalStringPtr(_:_:)](corefoundation/cfstringgetpascalstringptr(_:_:).md)
- [CFStringGetRangeOfComposedCharactersAtIndex(_:_:)](corefoundation/cfstringgetrangeofcomposedcharactersatindex(_:_:).md)
