Quantcast
Channel: Hey, Scripting Guy! Blog
Viewing all articles
Browse latest Browse all 3333

PowerTip: Return Specific Number of Letters from String

$
0
0

Summary: Use Windows PowerShell to return a specific number of letters from a string.

Hey, Scripting Guy! Question How can I use Windows PowerShell to easily to retrieve the first two letters from a string?

Hey, Scripting Guy! Answer Use the SubString method from a string, and then specify the starting the position and the number
           of letters to return, for example:

PS C:\> ("string").Substring(0,2)

st


Viewing all articles
Browse latest Browse all 3333

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>