Insert and Remove

The Insert method is able to add one string into another. This method expects an index from the beginning of the string, counting from 0, and a string to insert:

$string = 'The letter of the alphabet is a' 
$string.Insert(4, 'first ')  # Insert this before "letter", include a trailing space 

The Remove method removes characters from a string based on a start position and the length of the string to remove:

$string = 'This is is an example' 
$string.Remove(4, 3) 

The previous statement removes the first instance of is, including the trailing space.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.22.71.106