SecurityElement.IsValidTag Method (String)


Determines whether a string is a valid tag.

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

public static bool IsValidTag(
	string tag


Type: System.String

The tag to test for validity.

Return Value

Type: System.Boolean

true if the tag parameter is a valid XML tag; otherwise, false.

This can be used to test a Tag before setting it.

The following code shows the use of the IsValidTag method to determine whether a string is a valid attribute tag. This code example is part of a larger example provided for the SecurityElement class.

if (SecurityElement.IsValidTag(tagName))

.NET Framework
Available since 1.1
Return to top