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

PowerTip: Get First 140 Characters from String with PowerShell

$
0
0

Summary: Use Windows PowerShell to retrieve the first 140 characters from a string.

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

Hey, Scripting Guy! Answer Use the SubString method from a string. Specify the starting point (in this case 0) and the
           number of characters to retrieve (in this case 140). The following example assumes that $a 
           contains a string with more than 140 characters:

$a.SubString(0,140)


Viewing all articles
Browse latest Browse all 3333

Trending Articles