Computer Science, asked by rajnandini64, 8 months ago

Which of the following method call gives the position of ‘X’ that occurs after n^th position in the string S1.

Select one:

a. S1.index(‘X’, 1)

b. S1. index(‘X’ , n)

c. S1.indexOf(‘X’ , n)

d. S1.indexOf(‘X’)​

Answers

Answered by krishnabarnwal843
0

Answer:

hi friends this question is not inform for me sorry

Answered by sourasghotekar123
0

Answer:

From the given options, the correct option is C) S1.indexOf('X', n).

We can also convert a String to a String array by using the List class's toArray() method. It accepts a list of String entities as input and converts each one into a string array.

Explanation:

  • Because we are operating on a null reference variable.
  • The character at the specified index in a string is returned by the charAt() method. The first character has a zero index, the second has a one index, and so on.
  • The split() and Array. from() functions in JavaScript can be used to convert a string into a character array. String split() function usage: The str. split() function divides a string into an array of strings by separating it into substrings with a separator specified in the argument.

#SPJ5

Similar questions