java remove a character from string except numbers
String str = "a12.334tyz.78x";
str = str.replaceAll("[^\\d.]", "");
java remove a character from string except numbers
String str = "a12.334tyz.78x";
str = str.replaceAll("[^\\d.]", "");
how to remove leading space in java
import java.io.*;
public class Main {
public static void main(String args[]) {
String str = new String(" Jack Sparrow ");
System.out.println("String: "+str);
System.out.print("Result after removing leading and trailing spaces:" );
System.out.println(str.trim() );
}
}
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