[android-components](../../index.md) / [mozilla.components.lib.dataprotect](../index.md) / [SecureAbove22Preferences](index.md) / [getString](./get-string.md)

# getString

`fun getString(key: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`): `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`?` [(source)](https://github.com/mozilla-mobile/android-components/blob/master/components/lib/dataprotect/src/main/java/mozilla/components/lib/dataprotect/SecureAbove22Preferences.kt#L76)

Retrieves a stored [key](#). See [putString](#) for storing a [key](#).

### Parameters

`key` - A key name.

**Return**
An optional [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) if [key](#) is present in the store.

