how to delete character certain index in java
public static String charRemoveAt(String str, int p) {
return str.substring(0, p) + str.substring(p + 1);
}
how to delete character certain index in java
public static String charRemoveAt(String str, int p) {
return str.substring(0, p) + str.substring(p + 1);
}
Java remove element at position from array and shift
static void deleteStudent() {
System.out.println("Which student would you like to delete?"); //fixed spelling error
for(int i=0;i<9;i++) {
System.out.println(i + ": " + studentNamesArray[i]);
}
int studentChoice = input.nextInt();
StudentName[] temp = new StudentName[studentNamesArray.length];//I don't know format
for(int i = 0; i<studentNamesArray.length; i++) {
if(i != studentChoice)
{
temp[j] = studentNamesArray[i]
}
}
temp[studentNamesArray.length-1] = null;
studentNamesArray = temp;
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us