{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

StringResourcesKt

public final class StringResourcesKt


Summary

Public methods

static final @NonNull String

Load a plurals resource.

static final @NonNull String
@Composable
pluralStringResource(
    @PluralsRes int id,
    int count,
    @NonNull Object formatArgs
)

Load a plurals resource with provided format arguments.

static final @NonNull String[]

Load a string resource.

static final @NonNull String

Load a string resource.

static final @NonNull String

Load a string resource with formatting.

Public methods

pluralStringResource

@Composable
public static final @NonNull String pluralStringResource(@PluralsRes int id, int count)

Load a plurals resource.

Parameters
@PluralsRes int id

the resource identifier

int count

the count

Returns
@NonNull String

the pluralized string data associated with the resource

pluralStringResource

@Composable
public static final @NonNull String pluralStringResource(
    @PluralsRes int id,
    int count,
    @NonNull Object formatArgs
)

Load a plurals resource with provided format arguments.

Parameters
@PluralsRes int id

the resource identifier

int count

the count

@NonNull Object formatArgs

arguments used in the format string

Returns
@NonNull String

the pluralized string data associated with the resource

stringArrayResource

@Composable
public static final @NonNull String[] stringArrayResource(@ArrayRes int id)

Load a string resource.

Parameters
@ArrayRes int id

the resource identifier

Returns
@NonNull String[]

the string data associated with the resource

stringResource

@Composable
public static final @NonNull String stringResource(@StringRes int id)

Load a string resource.

Parameters
@StringRes int id

the resource identifier

Returns
@NonNull String

the string data associated with the resource

stringResource

@Composable
public static final @NonNull String stringResource(@StringRes int id, @NonNull Object formatArgs)

Load a string resource with formatting.

Parameters
@StringRes int id

the resource identifier

@NonNull Object formatArgs

the format arguments

Returns
@NonNull String

the string data associated with the resource