Visualizzazione dei risultati da 1 a 2 su 2

Discussione: Aiuto per un metodo

  1. #1
    Utente di HTML.it
    Registrato dal
    Dec 2008
    Messaggi
    9

    Aiuto per un metodo

    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

  2. #2
    Moderatore di Programmazione L'avatar di LeleFT
    Registrato dal
    Jun 2003
    Messaggi
    17,304

    Moderazione

    E non è lo stesso problema postato nella sezione "Programmazione" che ho appena spostato?

    Ovvero, questo: http://forum.html.it/forum/showthrea...readid=1293803


    Il cross-posting non è ammesso nel forum e una lettura del Regolamento su come scrivere i titoli non guasta...


    Chiudo questa, si continua l'altra indicata.


    Ciao.
    "Perchè spendere anche solo 5 dollari per un S.O., quando posso averne uno gratis e spendere quei 5 dollari per 5 bottiglie di birra?" [Jon "maddog" Hall]
    Fatti non foste a viver come bruti, ma per seguir virtute e canoscenza

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.