Salve, ho creato una classe che rappresenta dei messaggi, chiamata appunto Message.
Riporto il testo dell'esercizio:
Realize a Java class to represent messages. Each message is characterized by:
* a sender,
* a receiver,
* the text of the message.
All three types of information should be represented as strings. Besides the functionalities of getting and setting the sender, the receiver, and the text, messages should support the operation of swapping the sender and the receiver, and three forms of compression:
1. elimination of the white spaces at the beginning and at the end of the text, and replacement of each sequence of more than one whitespace (used to separate words) with a single white space;
2. elimination of all vowels;
3. both (1) and (2).
Il problema che riscontro è nel primo metodo, il numero 1. Potreste spiegarmi come realizzarlo?
Qualche linea di codice sarebbe di grande aiuto...
Grazie in anticipo