char* serialString()
{
static char str[21]; // For strings of max length=20
if (!Serial.available()) return NULL;
delay(64); // wait for all characters to arrive
memset(str,0,sizeof(str)); // clear str
byte count=0;
while (Serial.available())
{
   char c=Serial.read();
   if (c>=32 &&
count
   {
     str[count]=c;
     count++;
   }
}
str[count]='\0'; // make it a zero terminated string
return str;
}
void setup() {
Serial.begin(9600);
}
void loop()
{
static boolean needPrompt=true;
String userInput;
if (needPrompt)
{
   Serial.print(\"Please enter inputs and press
enter at the end:\n\");
   needPrompt=false;
}
userInput= serialString();
if (userInput!=NULL)
{
   Serial.print(\"You entered: \");
   Serial.println(userInput);
   Serial.println();
   userInput.toLowerCase();
   Serial.print(\"You Lower case String: \");
   Serial.println(userInput);
   Serial.println();
   needPrompt=true;
}
}