filmov
tv
09 | How to remove leading and trailing whitespaces from a string in Java 11

Показать описание
Illustrates how to remove leading and trailing whitespaces from a string in Java 11.
sample code
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package removewhitespacesusingstripmethod;
/**
*
* @author chimwemwe
*/
public class RemovewhitespacesUsingStripMethod {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
String s = " abc def/t";
}
}
sample code
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package removewhitespacesusingstripmethod;
/**
*
* @author chimwemwe
*/
public class RemovewhitespacesUsingStripMethod {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
String s = " abc def/t";
}
}