Split and Print array elements using Powershell

Rajnilari2015
Posted by Rajnilari2015 under PowerShell category on | Points: 40 | Views : 453
Suppose we have a string as under
"http://www.dotnetfunda.com/articles/show/3158/import-xml-file-and-transform-into-relational-model-for-dynamic-column"
we want to split and then print the string array elements.
Code

$string = "http://www.dotnetfunda.com/articles/show/3158/import-xml-file-and-transform-into-relational-model-for-dynamic-column"
$separator = "/"
$option = [System.StringSplitOptions]::RemoveEmptyEntries
$string.Split($separator,$option)


We are using the Split function for the operation

Result
http:
www.dotnetfunda.com
articles
show
3158
import-xml-file-and-transform-into-relational-model-for-dynamic-column

Comments or Responses

Login to post response