CSharpTest.Net
Remove Method
See Also  Example Send Feedback Download Help File
CSharpTest.Net.Library Assembly > CSharpTest.Net.Html Namespace > XmlLightAttributes Class : Remove Method

name

Glossary Item Box

Removes an item from the collection

Syntax

Visual Basic (Declaration) 
Public Function Remove( _
   ByVal name As String _
) As Boolean
C# 
public bool Remove( 
   string name
)

Parameters

name

Example

Library/Library.Test/TestHtmlParser.cs

C#Copy Code
string xml = "<root id='a'></root>";
XmlLightDocument doc = new XmlLightDocument(xml);
Assert.AreEqual("root", doc.Root.LocalName);
Assert.AreEqual(1, doc.Root.Attributes.Count);
Assert.IsTrue(doc.Root.Attributes.GetEnumerator().MoveNext());
Assert.IsTrue(((System.Collections.IEnumerable)doc.Root.Attributes).GetEnumerator().MoveNext());
Assert.IsTrue(doc.Root.Attributes.Remove("id"));
Assert.AreEqual(0, doc.Root.Attributes.Count);
VB.NETCopy Code
Dim xml As String = "<root id='a'></root>"
Dim doc As New XmlLightDocument(xml)
Assert.AreEqual("root", doc.Root.LocalName)
Assert.AreEqual(1, doc.Root.Attributes.Count)
Assert.IsTrue(doc.Root.Attributes.GetEnumerator().MoveNext())
Assert.IsTrue((DirectCast(doc.Root.Attributes, System.Collections.IEnumerable)).GetEnumerator().MoveNext())
Assert.IsTrue(doc.Root.Attributes.Remove("id"))
Assert.AreEqual(0, doc.Root.Attributes.Count)

Requirements

Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7

See Also

Generated with Document! X 2011 by Innovasys