;Task:

Given a character string &nbsp; (which may be empty, or have a length of zero characters):
::* &nbsp; create a function/procedure/routine to:
::::* &nbsp;  determine if all the characters in the string are the same
::::* &nbsp;  indicate if or which character is different from the previous character
::* &nbsp; display each string and its length &nbsp; (as the strings are being examined)
::* &nbsp; a zero─length (empty) string shall be considered as all the same character(s)
::* &nbsp; process the strings from left─to─right
::* &nbsp; if &nbsp; &nbsp; &nbsp; all the same character, &nbsp; display a message saying such
::* &nbsp; if                  not all the same character, &nbsp; then:
::::* &nbsp;  display a message saying such
::::* &nbsp;  display what character is different
::::* &nbsp;  only the 1<sup>st</sup> different character need be displayed
::::* &nbsp;  display where the different character is in the string
::::* &nbsp;  the above messages can be part of a single message
::::* &nbsp;  display the hexadecimal value of the different character


Use (at least) these seven test values &nbsp; (strings):
:::* &nbsp; a string of length &nbsp; 0 &nbsp; (an empty string)
:::* &nbsp; a string of length &nbsp; 3 &nbsp; which contains three blanks
:::* &nbsp; a string of length &nbsp; 1 &nbsp; which contains: &nbsp; '''2'''
:::* &nbsp; a string of length &nbsp; 3 &nbsp; which contains: &nbsp; '''333'''
:::* &nbsp; a string of length &nbsp; 3 &nbsp; which contains: &nbsp; '''.55'''
:::* &nbsp; a string of length &nbsp; 6 &nbsp; which contains: &nbsp; '''tttTTT'''
:::* &nbsp; a string of length &nbsp; 9 &nbsp; with a blank in the middle: &nbsp; '''4444 &nbsp; 444k'''



Show all output here on this page.

{{Template:Strings}}
<br><br>

