Data Manipulation with Strings in Studio Flashcards
What is data manipulation?
Data manipulation is the process of modifying, structuring, formatting, or sorting data in order to facilitate its usage and increase its management capabilities.
What does String.Concat method do?
Concatenates the string representations of two specified objects.
Expression: String.Concat (VarName1, VarName2)
Output datatype: String
What is the method that can be used to check whether a specified substring occurs within a String?
Contains method. It returns true or false.
Expression: VarName.Contains (“text”)
Output datatype: Boolean
What is String.Format method do?
Converts the value of objects to strings (and inserts them into another text).
Expression: String.Format(“{0} is {1}”, VarName1, VarName2)
Output datatype: String
What does the IndexOf method do?
Returns the zero-based index of the first occurrence of a specified Unicode character or string within this instance.
Expression: VarName1.IndexOf(“a”)
Output datatype: Int32
What does LastIndexOf method do?
Reports the zero-based index position of the last occurrence of a specified Unicode character or string within this instance.
Expression: VarName1.LastIndexOf(“author”)
Output datatype: Int32
What is the method to use to concatenate the elements in a collection and displays them as String.
String.Join
Expression: String.Join(“|”, CollVarName1)
Output datatype: String
What method should you use to replace all the occurrences of a substring in a string.
Replace.
Expression: VarName.Replace (“original”, “replaced”)
Output datatype: String
What is the output data type of Split method?
Array of Strings
What does Substring method do?
Extracts a substring from a string using the starting index and the length.
Expression: VarName1.Substring(startIndex, length)
Output datatype: String
What is the function of the Matches method in RegEx Builder?
Searches an input string for all the occurences and returns all the successful matches.
Output datatype: System.Collections.Generic.IEnumerable<System.Text.RegularExpressions.Match></System.Text.RegularExpressions.Match>
What is the function of the IsMatch method in RegEx Builder?
Indicates whether the specified regular expression finds a match in the specified input string.
Output datatype: Boolean
What is the function of the Replace method in RegEx Builder?
Replaces strings that match a regular expression pattern with a specified replacement string.
Output datatype: String
Choose four typical uses of RegEx:
A. String Parsing
B. Data Scraping
C. Interacting with UI Elements
D. String manipulation
E. Debugging
F. Input validation
A. String Parsing
B. Data Scraping
D. String manipulation
F. Input validation
Consider the string variable Letters = “abcdefg”.
Which out of the four values would the expression Letters.Substring(1,2) return?
- “ab”
2.”bcd”
3.”abc”
4.”bc”
- “bc”