Now it is right. This was solved. Thanks.
Type: Posts; User: dianac
Now it is right. This was solved. Thanks.
only with no spaces. Thanks
Hi Norm
Thank you
It was - encrypt but should have been -encrypt, so a blank space was the problem.
Now I need to take out all the blank spaces of s. Any idea of how could I do that?
An example is below:
public class CaesarBox {
public static void main(String[] args) {
// CaesarsBox <-encrypt|-decrypt>
if(args[0].equals("-encrypt")){
public static void main(String[] args) {
// CaesarsBox <-encrypt|-decrypt>
if(args[0].equals("-encrypt")){
System.out.println(encrypt(args[1]));
}
else...
String [] mess = args[1].toLowerCase(args[1]);
Error:
args cannot be resolved to a variable
--- Update ---
Sorry just saw your reply now.
args(0) is the input argument set by the user(text message)
--- Update ---
Sorry, args[0]
So it would be
String [] mess = args[0].toLowerCase(args[0]);
args(0) = "The sky is beautiful today"
I will encrypt this message later in a Caesar Box.
The error message is:
The method args(int) is undefined for the type CaesarBox
*ps: CaesarBox is...
Yes, sorry.
So I don't need to convert it to an array.
I need to change args(0) from "The sky is beautiful today" to theskyisbeautifultoday
I have tried
String [] mess =...
Thanks for your reply
Actually, args(0) = "The sky is beautiful today"
So args(0) is one string
args(0) is set by the user and could be any other text message
I need to convert a text message from the command line into an array of letters.
args(0) is a string, for example "The sky is beautiful today". And I want it to become theskyisbeautifultoday
...