Following operations can be performed using string operation command? a. Trim b. Compare c. Join d. All the options
Answers
Answered by
0
the answer is
d. All the option
d. All the option
Answered by
0
(d) All the options
Trim: trim() method is used in java to trim a the preceding and succeeding spaces in a string. The java lang.string.trim() is a built in java function. trim() does not accepts any parameter.
Eg. String s = “ Hello World ”;
System.out.println(s.trim());
Output: Hello World
Compare: In java string.equals() method compares two strings based on the content of the string. If all the contents of the string are same then it returns true otherwise false.
Eg. str1.equals(str2);
Join: the join() method in java concatenates the given elements with the delimiter and returns the concatenated string.
Eg. String s = String.join(" < ", "Four", "Five", "Six", "Seven");
Output: Four<Five<Six<Seven
garywalter1221:
reh gae chu*iya
Similar questions