<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreFoundation",
  "identifier" : "/documentation/CoreFoundation/CFStringInitInlineBuffer(_:_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Core Foundation"
    ],
    "preciseIdentifier" : "c:@F@CFStringInitInlineBuffer"
  },
  "title" : "CFStringInitInlineBuffer(_:_:_:)"
}
-->

# CFStringInitInlineBuffer(_:_:_:)

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

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

## Parameters

`str`

The string to copy to the in-line buffer.

`buf`

The (uninitialized) [`CFStringInlineBuffer`](/documentation/CoreFoundation/CFStringInlineBuffer) structure to initialize. On return, an initialized structure that can be used in a [`CFStringGetCharacterFromInlineBuffer(_:_:)`](/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

This function initializes an [`CFStringInlineBuffer`](/documentation/CoreFoundation/CFStringInlineBuffer) structure that can be used for accessing the characters of a string. Once the buffer is initialized you can call the [`CFStringGetCharacterFromInlineBuffer(_:_:)`](/documentation/CoreFoundation/CFStringGetCharacterFromInlineBuffer(_:_:)) function to access the characters in the buffer one at a time. The in-line buffer functions, along with the [`CFStringInlineBuffer`](/documentation/CoreFoundation/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.

---

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)