---
title: "addCharacters(in:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/nsmutablecharacterset/addcharacters(in:)-4ppyw"
---

# addCharacters(in:)

Adds to the receiver the characters whose Unicode values are in a given range.

## Declaration

```swift
func addCharacters(in aRange: NSRange)
```

## Parameters

- `aRange`: The range of characters to add. aRange.location is the value of the first character to add; aRange.location + aRange.length – 1 is the value of the last. If aRange.length is 0, this method has no effect.

## Discussion

Discussion This code excerpt adds to a character set the lowercase English alphabetic characters: NSMutableCharacterSet *aCharacterSet = [[NSMutableCharacterSet alloc] init]; NSRange lcEnglishRange;   lcEnglishRange.location = (unsigned int)'a'; lcEnglishRange.length = 26; [aCharacterSet addCharactersInRange:lcEnglishRange];

## See Also

### Related Documentation

- [String Programming Guide](apple-archive/documentation/Cocoa/Conceptual/Strings/introStrings.html.md)

### Adding and Removing Characters

- [removeCharacters(in:)](foundation/nsmutablecharacterset/removecharacters(in:)-70nqp.md)
- [addCharacters(in:)](foundation/nsmutablecharacterset/addcharacters(in:)-7q02.md)
- [removeCharacters(in:)](foundation/nsmutablecharacterset/removecharacters(in:)-762gt.md)
