Connect with a community of experts and enthusiasts on IDNLearn.com. Whether your question is simple or complex, our community is here to provide detailed and trustworthy answers quickly and effectively.

Which of the following would remove the first character and last character from the string and return the string between the first and last characters?
s[2:0]
s[1:0]
s[1:-1]
s[2:-2]


Sagot :

Using the knowledge in computational language in JAVA it is possible to write a code that first character and last character from the string and return the string between.

Writting the code:

String str = "[wdsd34svdf]";

//String str1 = str.replace("[","").replace("]", "");

String str1 = str.replaceAll("[^a-zA-Z0-9]", "");

System.out.println(str1);

String strr = "[wdsd(340) svdf]";

String strr1 = str.replaceAll("[^a-zA-Z0-9]", "");

System.out.println(strr1);

s[1:-1]

See more about JAVA at  brainly.com/question/12975450

#SPJ1

View image Lhmarianateixeira