---
title: "characterIndex(for:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/nstextlinefragment/characterindex(for:)"
---

# characterIndex(for:)

Returns character index for a point inside the line fragment coordinate system.

## Declaration

```swift
func characterIndex(for point: CGPoint) -> Int
```

## Parameters

- `point`: The distance is from the upstream edge.

## Return Value

Return Value An integer that represents the character index at point.

## See Also

### Finding specific text

- [fractionOfDistanceThroughGlyph(for:)](uikit/nstextlinefragment/fractionofdistancethroughglyph(for:).md)
- [locationForCharacter(at:)](uikit/nstextlinefragment/locationforcharacter(at:).md)
