Deck 8: String Manipulation
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/57
العب
ملء الشاشة (f)
Deck 8: String Manipulation
1
To remove characters from the left of,the right of,or within a string variable,you should use the ____ function.
A) Mid
B) Delete
C) Trim
D) Remove
A) Mid
B) Delete
C) Trim
D) Remove
D
2
You can use a string's Value property to determine the number of characters it stores.
False
3
When processing the PadLeft and PadRight methods,the computer makes a temporary copy of the string in memory,and then inserts the characters in the copy only.
True
4
You can use the ____ method to search a string to determine whether it contains a specific sequence of characters.
A) Contains
B) Insert
C) Substring
D) IndexOf
A) Contains
B) Insert
C) Substring
D) IndexOf
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
5
A character's ____ is an integer that indicates the character's position in the string.
A) charpos
B) index
C) chardex
D) pos
A) charpos
B) index
C) chardex
D) pos
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
6
The ____ method inserts the padded characters at the beginning of a string,which right-aligns the characters within the string.
A) PadStart
B) PadRight
C) PadBegin
D) PadLeft
A) PadStart
B) PadRight
C) PadBegin
D) PadLeft
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
7
To insert characters within a string,you use the ____ method.
A) Add
B) Insert
C) Mid
D) IndexOf
A) Add
B) Insert
C) Mid
D) IndexOf
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
8
The most commonly used properties for a menu element are the Name and Text properties.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
9
The following instruction will remove which character from the string first? Dim myString as string = "ABCDEFGH"
MyString = myString.Remove(2,3)
A) A
B) B
C) C
D) D
MyString = myString.Remove(2,3)
A) A
B) B
C) C
D) D
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
10
Assume that a text box named PhoneNumberTextBox appears on a form and contains the phone number 414-555-5555.What value will display for the length of the phone number text box?
A) 10
B) 12
C) 18
D) 20
A) 10
B) 12
C) 18
D) 20
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
11
The ____ method performs a case-sensitive search that returns the Boolean value True when the subString is contained anywhere in the string.
A) Insert
B) IndexOf
C) Contains
D) Substring
A) Insert
B) IndexOf
C) Contains
D) Substring
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
12
Menu title captions should be one word only and entered using uppercase letters.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
13
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
14
You should assign shortcut keys to every menu item.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
15
How many characters will be removed from the string below? Dim myString as string = "ABCDEFGH"
MyString = myString.Remove(2,3)
A) one
B) two
C) three
D) four
MyString = myString.Remove(2,3)
A) one
B) two
C) three
D) four
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
16
A literal type character forces a literal constant to assume a data type other than the one its form indicates.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
17
The Trim method is used to remove characters from the end of a string.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
18
The ____ method pads the string on the right,which inserts the padded characters at the end of the string and left-aligns the characters within the string.
A) PadEnd
B) PadRight
C) Padding
D) PadAll
A) PadEnd
B) PadRight
C) Padding
D) PadAll
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
19
Neither the Trim method nor the Remove method removes any characters from the original string.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
20
Each menu in an application does not have to contain a menu title.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
21
The method that removes characters from only the right end of a string is the ____ method.
A) Trim
B) TrimRight
C) TrimEnd
D) TrimR
A) Trim
B) TrimRight
C) TrimEnd
D) TrimR
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
22
The strPhone variable should contain only numbers and no dashes (-).An error message should display if there is a dash anywhere in the variable.Which of the following statements determines whether the variable contains a dash in order to display the message? 

فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
23
Programmers use the ____ property of the menu element to refer to the menu element in code.
A) Text
B) Name
C) Description
D) Title
A) Text
B) Name
C) Description
D) Title
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
24
The ____ operator evaluates to True when the string matches the pattern;otherwise,it evaluates to False.
A) Like
B) Menu
C) Add
D) Insert
A) Like
B) Menu
C) Add
D) Insert
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
25
If a menu item requires additional information from the user,the Windows standard is to place a(n)____ at the end of the caption.
A) underscore (_)
B) asterisk (*)
C) pound key (#)
D) ellipsis (…)
A) underscore (_)
B) asterisk (*)
C) pound key (#)
D) ellipsis (…)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
26
Which of the following shortcut keys should not be used in Windows applications that have an EDIT menu for menu items not on the EDIT menu?
A) Ctrl+X
B) Ctrl+Q
C) Ctrl+V
D) both a and c
A) Ctrl+X
B) Ctrl+Q
C) Ctrl+V
D) both a and c
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
27
The users of the HR application have entered some employee Social Security numbers (SSNs)with dashes (such as 222-33-4444)and some without dashes (such as 222334444).You need to remove all dashes from any SSN that contains dashes.You will use the ____ method to edit the code so that only numeric characters are stored.
A) Replace
B) Remove
C) Trim
D) Substring
A) Replace
B) Remove
C) Trim
D) Substring
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
28
To remove characters from only the beginning of a string,use the ____ method.
A) Trim
B) TrimBegin
C) TrimStart
D) TrimLeft
A) Trim
B) TrimBegin
C) TrimStart
D) TrimLeft
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
29
Each menu element is considered a(n)____ and has a set of properties associated with it.
A) class
B) character
C) object
D) string
A) class
B) character
C) object
D) string
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
30
The strPassword variable contains eight characters.Two of the characters in the password must be numeric.Which of the following statements will access each character stored in the variable,character by character? 

فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
31
____ keys appear to the right of a menu item and allow you to select an item without opening the menu.
A) Shortcut
B) Access
C) Menu
D) Caption
A) Shortcut
B) Access
C) Menu
D) Caption
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
32
The ____ allows you to use pattern-matching characters to determine whether one string is equal to another string.
A) Insert method
B) Like operator
C) Contains method
D) MenuStrip control
A) Insert method
B) Like operator
C) Contains method
D) MenuStrip control
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
33
Visual Basic provides the ____ method for accessing any number of characters contained in a string.
A) IndexOf
B) Insert
C) Contains
D) Substring
A) IndexOf
B) Insert
C) Contains
D) Substring
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
34
In order to remove both dashes from the SSN,you should first ____.
A) use the Length property to see how many characters are in the variable
B) use the index value to loop to examine each character in the variable,character by character
C) use the Contains method to see if any dashes are anywhere within the variable
D) use the Insert method to insert dashes
A) use the Length property to see how many characters are in the variable
B) use the index value to loop to examine each character in the variable,character by character
C) use the Contains method to see if any dashes are anywhere within the variable
D) use the Insert method to insert dashes
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
35
Assume that the value of the string message is "Happy New Year".What value would message.IndexOf("New")yield?
A) -1
B) 2
C) 6
D) 7
A) -1
B) 2
C) 6
D) 7
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
36
Assume that the data for salary is entered with both a dollar symbol and a space.Which of the following instructions will remove the dollar symbol?
A) salary.TrimStart("$")
B) salary.TrimLeft("$")
C) salary.TrimEnd("$")
D) salary.TrimRight("$")
A) salary.TrimStart("$")
B) salary.TrimLeft("$")
C) salary.TrimEnd("$")
D) salary.TrimRight("$")
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
37
The ____ method returns an integer that represents the location of the subString within the string.
A) Insert
B) IndexOf
C) Contains
D) Substring
A) Insert
B) IndexOf
C) Contains
D) Substring
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
38
What is the value returned from the expression stateName.Substring(1,1)when stateName contains "North Dakota"?
A) N
B) o
C) t
D) a
A) N
B) o
C) t
D) a
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
39
In Visual Basic 2012,you use a(n)____ to include one or more menus in an application.
A) Like operator
B) Contains method
C) Insert operator
D) MenuStrip control
A) Like operator
B) Contains method
C) Insert operator
D) MenuStrip control
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
40
The strState variable should contain two uppercase letters.Which of the following statements determines whether the variable contains a valid state? 

فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
41
Write the Visual Basic statement that inserts "RVI" at the beginning of the string in the following


فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
42
The strCityState variable contains a string that ends with a two-digit state abbreviation.Write the statements that determine whether the string stored in the strCityState variable ends with "NY".If it does,assign the string "New York order" to the lblState control's Text property.Use the EndsWith method.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
43
Write a Visual Basic statement that removes the last four digits of the credit card number and assigns it to the strCCLastFour variable.
strCCNum = "4456778996352852"
strCCNum = "4456778996352852"
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
44
Write the Visual Basic statements needed to format decNetPay with two decimal places,pad the formatted variable with asterisks until its length is 12,and then insert a dollar sign ($)as the first character.The result is assigned to the strNetPayFormat variable.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
45
Each employee is assigned an employee code,such as F01234,which is stored in the strEmpCode variable.The first character is a letter for employment status (F for Full-time,P for Part-time).The next two characters are numbers representing the employee's department number.The last three characters are numbers representing a unique value for each individual employee.Which of the following statements assigns the employee's department to the strDept variable?
A) strDept = strEmpCode.Substring(0,1)
B) strDept = strEmpCode.Substring(1)
C) strDept = strEmpCode.Substring(0,2)
D) strDept = strEmpCode.Substring(1,2)
A) strDept = strEmpCode.Substring(0,1)
B) strDept = strEmpCode.Substring(1)
C) strDept = strEmpCode.Substring(0,2)
D) strDept = strEmpCode.Substring(1,2)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
46
Write the Visual Basic statement that uses the Contains method to determine whether the strEmployeeCode variable contains the string "NC" (entered in uppercase).Assign the method's return value to a Boolean variable named blnIsNC.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
47
The strPhone variable contains a 10-digit phone number.If the string stored in the strPhone variable begins with the "336" area code,display the phone number in the lblPhone control's Text property.Use the StartsWith method.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
48
The HR department has decided to change the Finance department number from 04 to 09.Which of the following statements correctly changes the contents of the strEmpCode?
A) strEmpCode = strEmpCode.Replace("04","09")
B) strEmpCode = strEmpCode.Replace("09","04")
C) strEmpCode = strEmpCode.Remove(0,2)
StrEmpCode = strEmpCode.Insert(1,"09")
D) strEmpCode = strEmpCode.Remove(1,2)
StrEmpCode = strEmpCode.Insert(1,"04")
A) strEmpCode = strEmpCode.Replace("04","09")
B) strEmpCode = strEmpCode.Replace("09","04")
C) strEmpCode = strEmpCode.Remove(0,2)
StrEmpCode = strEmpCode.Insert(1,"09")
D) strEmpCode = strEmpCode.Remove(1,2)
StrEmpCode = strEmpCode.Insert(1,"04")
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
49
The strCityState variable contains the string "AtlantaGA".Write the Visual Basic statements that assign the string "Atlanta" from the strCityState variable to the strCity variable,and assign the string "GA" to the strState variable.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
50
Write the condition that evaluates to True when a dash (-)appears anywhere within the strItemNum variable.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
51
The strSerialNum variable contains the string "DRY259614".Write the Visual Basic statement that assigns the string "259614" from the strSerialNum variable to the strProductCode variable.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
52
The txtGrade control contains the string "95%".Write the Visual Basic statement to remove the percent sign from the txtGrade control as well as convert the contents of the control to a Decimal number.Assign the result to the decGrade variable.Use the TrimEnd method.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
53
Write the Visual Basic statement to assign the number of characters in the txtSSN control's Text property to the intSSNNumChar variable.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
54
What is the difference between a menu item's access key and shortcut key?
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
55
Write the condition that evaluates to True when the string stored in the strCode variable begins with "HFS",followed by two uppercase letters,followed by five numbers.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
56
Write a Visual Basic statement that will access each character in the strNumber variable to determine if the variable contains a comma and then removes any comma that is found.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck
57
The application needs to process benefits for full-time employees only.Which of the following statements determines whether the strEmpCode variable contains an employee code for a full-time employee?
A) If strEmpCode Like "[A-Z]#####"
B) If strEmpCode.ToUpper Like "F####"
C) If strEmpCode Like "F*"
D) If strEmpCode Like "!F*"
A) If strEmpCode Like "[A-Z]#####"
B) If strEmpCode.ToUpper Like "F####"
C) If strEmpCode Like "F*"
D) If strEmpCode Like "!F*"
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 57 في هذه المجموعة.
فتح الحزمة
k this deck