---
title: "xpc_string_get_length(_:)"
framework: xpc
role: symbol
role_heading: Function
path: "xpc/xpc_string_get_length(_:)"
---

# xpc_string_get_length(_:)

Returns the length of the underlying string.

## Declaration

```swift
func xpc_string_get_length(_ xstring: xpc_object_t) -> Int
```

## Parameters

- `xstring`: The string object which is to be examined.

## Return Value

Return Value The length of the underlying string, not including the NULL-terminator.

## See Also

### String objects

- [xpc_string_create(_:)](xpc/xpc_string_create(_:).md)
- [xpc_string_create_with_format_and_arguments(_:_:)](xpc/xpc_string_create_with_format_and_arguments(_:_:).md)
- [xpc_string_get_string_ptr(_:)](xpc/xpc_string_get_string_ptr(_:).md)
