Substring/Top and tail: Difference between revisions

no edit summary
m (→‎{{header|REXX}}: added/changed whitespace and comments, added a faster version, added a version for easier reading.)
No edit summary
Line 953:
One character from each end removed=ow is the time to come to the aid of the part
</pre>
 
=={{header|PowerShell}}==
{{works with|PowerShell|4.0}}
===First method===
<lang PowerShell>
$string = "head and tail"
$string
$string.Substring(1)
$string.Substring(0, $string.Length - 1)
$string.Substring(1, $string.Length - 2)
</lang>
===Second method===
<lang PowerShell>
$string = "head and tail"
$string
$string[1..($string.Length - 1)] -join ""
$string[0..($string.Length - 2)] -join ""
$string[1..($string.Length - 2)] -join ""
</lang>
<b>Output:</b>
<pre>
head and tail
ead and tail
head and tai
ead and tai
</pre>
 
 
=={{header|Prolog}}==
678

edits