Suppose I want to do something like this:
$string = 'arbitrary string' # << is random $string = ($string + 'randomstring').Substring(0, [math]::Min(20, $string.lenght) # < doesn't work properly
How to get the current length $stringif it is not assigned yet?
$string
Just assign a string using +=.
+=
$string = 'arbitrary string' # << is random $string = ($string += 'randomstring').Substring(0, [math]::MIN(20, $string.Length)) #
Source: https://habr.com/ru/post/1670725/More articles:Affix bootstrap issue when affix div has more content and window - javascriptAndroid Why is the Facebook SDK logout button not showing? - androidAdding Azure Ad Oauth2 JWT Token Claims - c #Java compare two Dates Year, month and day - javaHow to iterate on a SPARQL query, referencing a virtual graph? - iterationKDB reverse asof join (aj), т.е. Следующая цитата вместо предыдущей - joinNodejs passport with local token with Mysql - node.jsGoogle Places API - Angular 2 / Typescript / Ionic 2 - angularHow can I tell ReSharper that I am using a shell for Debug.Assert to avoid empty ref links? - c #Angular2 - ngZone - google.maps does not trigger change detection - angularAll Articles