Programming 2- module 10) Flashcards
What does handling strings refer to?
‘Groups of characters’.
What are there a range of that you might need to perform on strings?
Operations.
What is length?
Number of characters.
What is the position?
Location of specified substring.
What is concatenation?
Joining of strings end-to-end.
What is an important characteristic of each string?
Its length.
What can the length of a string be?
Any whole number or integer.
What is a substring?
Any contiguous sequence of characters within a string.
What tasks are there?
Return the length of a string. Return the position in a string. Return the substring data within the string. Concatenation of 2 strings. Convert string -> integer. Convert integer -> string. Convert string -> real. Convert real -> string. Convert content of string -> upper case. Convert content of string -> lower case. Comparison of 2 strings.
What are the pseudocode examples of the return the length of a string task?
Stringname.length OR LEN(stringname).
What is a pseudocode example of the return the position in a string task?
String.indexOf(n).
What is the pseudocode example of the return the substring data within the string task?
Stringname.
SubString(startingPosition, numberOfCharacters).
What is the pseudocode example of the concatenation of two strings?
String.Join OR NewString = String1 + String2 (can also sometimes include: , and &).
What is the pseudocode example of the task: convert string to integer?
int(string).
What is the pseudocode example of the task: convert integer to string?
str(integer).