I am working to send SMS using java program.
The AT command is supping as a string. But the string format should be like
AT+CMGS="+33146290800"<CR>Please call me soon.<ctrl-Z>.
I have to create string with the Carriage Return and CTRL-Z character.
output:
AT+CMGS="+33146290800"13Please call me soon.26
How can I achieve the task? Can anyone help me to find a way out.
To get this string:
"+33146290800"<CR>Please call me soon.<ctrl-Z>
You use this string literal:
String s = "\"+33146290800\"\rPlease call me soon.\u001A";
\" is the Java string literal escape sequence for a double quote, \r is escape sequence a carriage return, and \u0026 is the Java string literal Unicode escape sequence for character x1A (decimal 26), e.g., Ctrl+Z. More to explore in the JLS.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With