StringLocalizerExtensions.GetString Method

Definition

Overloads

GetString(IStringLocalizer, String)

Gets the string resource with the given name.

GetString(IStringLocalizer, String, Object[])

Gets the string resource with the given name and formatted with the supplied arguments.

GetString(IStringLocalizer, String)

Source:
StringLocalizerExtensions.cs
Source:
StringLocalizerExtensions.cs
Source:
StringLocalizerExtensions.cs

Gets the string resource with the given name.

C#
public static Microsoft.Extensions.Localization.LocalizedString GetString(this Microsoft.Extensions.Localization.IStringLocalizer stringLocalizer, string name);

Parameters

stringLocalizer
IStringLocalizer

The IStringLocalizer.

name
String

The name of the string resource.

Returns

The string resource as a LocalizedString.

Applies to

.NET 10 (package-provided) and .NET Standard 2.0 (package-provided)
Product Versions
.NET 10 (package-provided)
.NET Standard 2.0 (package-provided)

GetString(IStringLocalizer, String, Object[])

Source:
StringLocalizerExtensions.cs
Source:
StringLocalizerExtensions.cs
Source:
StringLocalizerExtensions.cs

Gets the string resource with the given name and formatted with the supplied arguments.

C#
public static Microsoft.Extensions.Localization.LocalizedString GetString(this Microsoft.Extensions.Localization.IStringLocalizer stringLocalizer, string name, params object[] arguments);

Parameters

stringLocalizer
IStringLocalizer

The IStringLocalizer.

name
String

The name of the string resource.

arguments
Object[]

The values to format the string with.

Returns

The formatted string resource as a LocalizedString.

Applies to

.NET 10 (package-provided) and .NET Standard 2.0 (package-provided)
Product Versions
.NET 10 (package-provided)
.NET Standard 2.0 (package-provided)