ResourceSet.GetString Method (String, Boolean)

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Searches for a String resource with the specified name in a case-insensitive manner, if requested.

Namespace: System.Resources
Assembly: mscorlib (in mscorlib.dll)

Syntax

Public Overridable Function GetString ( _
    name As String, _
    ignoreCase As Boolean _
) As String
public virtual string GetString(
    string name,
    bool ignoreCase
)

Parameters

  • ignoreCase
    Type: System..::.Boolean
    Indicates whether the case of the case of the specified name should be ignored.

Return Value

Type: System..::.String
The value of a resource, if the value is a String.

Exceptions

Exception Condition
ArgumentNullException

The name parameter is nullNothingnullptra null reference (Nothing in Visual Basic).

InvalidOperationException

The resource with the specified name is not a String or the current ResourceSet has been closed.

ObjectDisposedException

The object has been disposed.

Remarks

If the value of the ignoreCase parameter is true, a resource with the name "Resource" is equivalent to the resource with the name "resource". Note, however, that this method always performs case-insensitive string comparisons using CultureInfo..::.InvariantCulture. The advantage is that results of case-insensitive string comparisons performed by this method are the same on all computers regardless of culture. The disadvantage is that the results are not consistent with the casing rules of all cultures.

For example, the Turkish alphabet has two versions of the character I: one with a dot and one without a dot. In Turkish, the character I (Unicode 0049) is considered the uppercase version of a different character ı (Unicode 0131). The character i (Unicode 0069) is considered the lowercase version of yet another character İ (Unicode 0130). According to these casing rules, a case-insensitive string comparison of the characters i (Unicode 0069) and I (Unicode 0049) should fail for the culture "tr-TR" (Turkish in Turkey). Using the GetString method with ignoreCase set to true, this comparison succeeds.

Version Information

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Platforms

Windows Phone

See Also

Reference

ResourceSet Class

GetString Overload

System.Resources Namespace