Quantcast
Channel: How do I create a string with repeating characters?
Viewing all articles
Browse latest Browse all 6

How do I create a string with repeating characters?

$
0
0
It is interesting to compare these uses of
"*" * 35
 
PS C:> "*" * 35
***********************************
PS C:> 35 * "*"
The '*' operator failed: Cannot convert value "*" to type
"System.Int32". ...
 
(string's * operator is not commutative)
 
PS C:> write-output "*" * 35
*
*
35
PS C:> write-output ("*" * 35)
***********************************
 
(using Write-Output is tricky)
 
 

Viewing all articles
Browse latest Browse all 6

Trending Articles



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