Sort array elements using Powershell

Rajnilari2015
Posted by Rajnilari2015 under PowerShell category on | Points: 40 | Views : 392
$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) | sort


The Sort filter is sorting the string array elements.

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

Comments or Responses

Login to post response