Deck 23: The String Section String Manipulation
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Question
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/25
Play
Full screen (f)
Deck 23: The String Section String Manipulation
1
The syntax for the trim method is ____.
A) Trim.string
C) string.TrimMethod
B) string.Trim
D) trim(string)
A) Trim.string
C) string.TrimMethod
B) string.Trim
D) trim(string)
B
2
You can use the ____ method to remove any spaces from both the beginning and end of a string.
A) Clean
C) Cut
B) CleanWhiteSpace
D) Trim
A) Clean
C) Cut
B) CleanWhiteSpace
D) Trim
D
3
The syntax of the Replace method is ____.
A) Replace.string(oldValue, newValue)
B) string.Replace(newValue, oldValue)
C) string.Replace(oldValue, newValue)
D) string.Replace(newValue)(oldValue)
A) Replace.string(oldValue, newValue)
B) string.Replace(newValue, oldValue)
C) string.Replace(oldValue, newValue)
D) string.Replace(newValue)(oldValue)
C
4
When processing the Insert method, the computer makes a temporary copy of the string in memory, and then inserts the characters in the copy only.
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
5
When processing the Trim method, the computer first makes a permanent backup copy of the string in memory.
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
6
When entering data in a text box or input box, it's not unusual for a user to inadvertently press the spacebar either before or after typing the data.
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
7
You can use the ____ method to search a string to determine whether it contains a specific sequence of characters.
A) IndexOf
C) Location
B) Index
D) Locate
A) IndexOf
C) Location
B) Index
D) Locate
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
8
Visual Basic provides the Replace method for replacing a sequence of characters in a string with another sequence of characters.
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
9
The syntax of the length property is ____.
A) string.Length
C) Length.string
B) Length(string)
D) string.Len
A) string.Length
C) Length.string
B) Length(string)
D) string.Len
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
10
The startIndex argument is not optional in the IndexOf method's syntax.
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
11
Using the Insert method to insert a value beginning with the fifth character in a string, you use a starting index of 5.
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
12
The Trim method removes characters from the original string.
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
13
You insert characters using the ____ method.
A) Insert
C) Input
B) InStr
D) InsertInto
A) Insert
C) Input
B) InStr
D) InsertInto
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
14
The syntax of the insert method is ____.
A) string.Insert(value,startIndex)
B) Insert(startIndex,value).string
C) string.Insert(value).startIndex
D) string.Insert(startIndex, value)
A) string.Insert(value,startIndex)
B) Insert(startIndex,value).string
C) string.Insert(value).startIndex
D) string.Insert(startIndex, value)
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
15
The Trim method returns a string that excludes any leading or trailing spaces.
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
16
The first character in a string has an index of 1.
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
17
The Like operator evaluates to True when the string matches the pattern.
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
18
The number of characters contained in a string is stored in the string's ____ property.
A) Size
C) Length
B) Len
D) StringLength
A) Size
C) Length
B) Len
D) StringLength
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
19
If an application expects the user to enter a seven-digit phone number or a five-digit ZIP code, the application's code should verify that the user entered the required number of characters.
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
20
Applications rarely need to manipulate (process) string data.
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
21
Visual Basic provides the ____ method for accessing any number of characters contained in a string.
A) Portion
C) Substring
B) PartialString
D) PieceString
A) Portion
C) Substring
B) PartialString
D) PieceString
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
22
The syntax for the substring method is ____.
A) Substring.string(startIndex)
B) string.Substring(startIndex[, numCharsToAccess])
C) string.Substring(numCharsToAccess,startIndex)
D) string.Substring([numCharsToAccess],startIndex)
A) Substring.string(startIndex)
B) string.Substring(startIndex[, numCharsToAccess])
C) string.Substring(numCharsToAccess,startIndex)
D) string.Substring([numCharsToAccess],startIndex)
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
23
The syntax of the IndexOf method is ____.
A) string.IndexOf(subString[, startIndex])
B) string.IndexOf.subString
C) subString.IndexOf(string)
D) string.IndexOf(startIndex, subString)
A) string.IndexOf(subString[, startIndex])
B) string.IndexOf.subString
C) subString.IndexOf(string)
D) string.IndexOf(startIndex, subString)
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
24
The ____ operator allows you to use pattern-matching characters to determine whether one string is equal to another string.
A) Similar
C) HasSimilarity
B) Comparable
D) Like
A) Similar
C) HasSimilarity
B) Comparable
D) Like
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck
25
You also can include a range of values in a character list by using a(n) ____ to separate the lowest value in the range from the highest value in the range.
A) hyphen
C) equal sign
B) apostrophe
D) plus sign
A) hyphen
C) equal sign
B) apostrophe
D) plus sign
Unlock Deck
Unlock for access to all 25 flashcards in this deck.
Unlock Deck
k this deck