Ask Learn
Preview
Please sign in to use this experience.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
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.
Returns the specified string resource for the specified culture or current UI culture.
GetString(String) |
Returns the value of the specified string resource. |
GetString(String, CultureInfo) |
Returns the value of the string resource localized for the specified culture. |
Returns the value of the specified string resource.
public:
System::String ^ GetString(System::String ^ name);
public:
virtual System::String ^ GetString(System::String ^ name);
public string GetString(string name);
public virtual string? GetString(string name);
public virtual string GetString(string name);
member this.GetString : string -> string
abstract member GetString : string -> string
override this.GetString : string -> string
Public Function GetString (name As String) As String
Public Overridable Function GetString (name As String) As String
The name of the resource to retrieve.
The value of the resource localized for the caller's current UI culture, or null
if name
cannot be found in a resource set.
The name
parameter is null
.
The value of the specified resource is not a string.
No usable set of resources has been found, and there are no resources for the default culture. For information about how to handle this exception, see the "Handling MissingManifestResourceException and MissingSatelliteAssemblyException Exceptions" section in the ResourceManager class topic.
The default culture's resources reside in a satellite assembly that could not be found. For information about how to handle this exception, see the "Handling MissingManifestResourceException and MissingSatelliteAssemblyException Exceptions" section in the ResourceManager class topic.
For more information about this API, see Supplemental API remarks for ResourceManager.GetString.
The GetString(String) method is thread safe.
Product | Versions |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 1.0, 1.1, 1.2, 1.3, 1.4, 1.6, 2.0, 2.1 |
UWP | 10.0 |
Returns the value of the string resource localized for the specified culture.
public:
virtual System::String ^ GetString(System::String ^ name, System::Globalization::CultureInfo ^ culture);
public virtual string GetString(string name, System.Globalization.CultureInfo culture);
public virtual string? GetString(string name, System.Globalization.CultureInfo? culture);
abstract member GetString : string * System.Globalization.CultureInfo -> string
override this.GetString : string * System.Globalization.CultureInfo -> string
Public Overridable Function GetString (name As String, culture As CultureInfo) As String
The name of the resource to retrieve.
An object that represents the culture for which the resource is localized.
The value of the resource localized for the specified culture, or null
if name
cannot be found in a resource set.
The name
parameter is null
.
The value of the specified resource is not a string.
No usable set of resources has been found, and there are no resources for a default culture. For information about how to handle this exception, see the "Handling MissingManifestResourceException and MissingSatelliteAssemblyException Exceptions" section in the ResourceManager class topic.
The default culture's resources reside in a satellite assembly that could not be found. For information about how to handle this exception, see the "Handling MissingManifestResourceException and MissingSatelliteAssemblyException Exceptions" section in the ResourceManager class topic.
For more information about this API, see Supplemental API remarks for ResourceManager.GetString.
The GetString(String, CultureInfo) method is thread safe.
Product | Versions |
---|---|
.NET | Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10 |
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET Standard | 1.0, 1.1, 1.2, 1.3, 1.4, 1.6, 2.0, 2.1 |
UWP | 10.0 |
.NET feedback
.NET is an open source project. Select a link to provide feedback:
Please sign in to use this experience.
Sign in