開発者は、StrVar という名前の String 型の変数を宣言し、それに値「UIPATH STUDIO」を割り当てました。式 StrVar.lndexOf("U") の出力は何ですか?
正解:A
Explanation
The IndexOf method of String values returns the index of the first occurrence of a specified character or substring in a given string. The index is zero-based, meaning that the first character has the index 0, the second character has the index 1, and so on. If the character or substring is not found, the method returns -1. In this case, the expression StrVar.IndexOf("U") returns the index of the first occurrence of the character "U" in the string "UIPATH STUDIO", which is 0. Therefore, the answer is A. 0. References: String.IndexOf Method, String Variables