Sure wish I could tie my shoe strings.
Strings are so common I feel it very important to discuss in more detail how to work with and manipulate them. I am going to list some examples of just a few of the tools that will be helpful in working with strings. To better understand the format of the string command examine the manual pages.
Assignment 8.48
Write a program that will collect a string from a user and return the
length of the string. Try the command: string length $stringVar
Assignment 8.49
Write a program that will accept a string and a number to determine
what character is located at that position in the string. Consider
what the index of the first element of a string would be.
Assignment 8.50
Write a program that will convert a string from the case entered to
all upper or to all lower. Consider how to do just one character.
Assignment 8.51
From the manual pages write a program to extract a given substring
from a string. The user should be able to declare the start and end
positions of this substring.
Assignment 8.52
Write a program that will count occurrences of a given character in
a string. The user should be able to enter the string and the character.
Consider occurrences of a string of characters in the string.
Assignment 8.53
Be prepared to use any options on the string command.
I have often pondered how you split a penny.
Working with strings will often require you to break them up into smaller segments. Often these segments are part of a larger picture. Examine the manual pages for more info.
Assignment 8.54
Write a program that will read the information from the file created
in Assignment 7.46 and place the information back on the screen into a
widget designed for each field.
I never can get that copier to sort correctly.
Sorting is a very exciting topic. In the old days making sure that computers could perform and complete tasks before you had to use them again was very important. Such as, could your computer generate you chart of accounts over the weekend, while sorting the companies accounts database in a given order with everything ready to go on Monday? Today with all the processing power that we have, sorting and major system resource operations usually offer little performance problems. I am including this topic briefly because I think it is important to understand basic sorting operations. The most basic form of sorting is called the bubble sort. This method of sorting, as the name suggests , allows information to bubble to the top, via some substitution and counting.
Assignment 8.55
Write a program that will read information from a file, sort the information
using arrays, display into a message or label widget. (See Appendix
22 for more information on arrays.)