Mega Code Archive

 
Categories / VB.Net / XML LINQ
 

ReplaceAll with a string array

Imports System Imports System.Xml Imports System.Xml.XPath Public Class MainClass     Public Shared Sub Main()         Dim root As XElement = _              <Root>                 <Child>child content</Child>             </Root>                  Dim stringArray As String() = { _             "abc", _             "def", _             "ghi" _         }         root.ReplaceAll(stringArray)         Console.WriteLine(root)     End Sub End Class