Question: When a relatively short character string is assigned to a longer character variable, the extra space in the variable is filled with blanks. In many
When a relatively short character string is assigned to a longer character variable, the extra space in the variable is filled with blanks. In many circumstances, we would like to use a substring consisting of only the nonblank portions of the character variable. To do so, we need to know where the nonblank portions are within the variable. Write a subroutine that will accept a character string of arbitrary length, and return two integers containing the numbers of the first and last nonblank characters in the variable. Test your subroutine with several character variables of different lengths and with different contents.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
