Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class CustomType2 {
- private String sentense;
- public CustomType2() {
- }
- public CustomType2(String string) {
- this.setSentense(string);
- }
- public CustomType2(CustomType2 ct2) {
- this.setSentense(ct2.getSentense());
- }
- public void removeSingleWord (){
- String[] temp = this.getSentense().split("\\s|,");
- this.setSentense("");
- for(int i = 0; i < temp.length; i++){
- if(temp[i].length() == 1 && !temp[i].isEmpty()){
- this.append(temp[i]);
- }
- }
- }
- public String getSentense() {
- return sentense;
- }
- public void setSentense(String sentense) {
- this.sentense = sentense;
- }
- public void append(String sentense) {
- this.sentense += sentense + " ";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement