อ่านในภาษาอังกฤษ

แชร์ผ่าน


StringLocalizerExtensions.GetString Method

Definition

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

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) และ .NET Standard 2.0 (package-provided)
ผลิตภัณฑ์ เวอร์ชัน
.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) และ .NET Standard 2.0 (package-provided)
ผลิตภัณฑ์ เวอร์ชัน
.NET 10 (package-provided)
.NET Standard 2.0 (package-provided)