user15686: Currently I convert the characters in char received[20] to string using String randomString(received) and I am able to display it using Serial.println(randomString). After displaying the string, I would like to know the easiest way to clear out its contents.

user10907: In C and C++ a null terminated array of characters is a string (although not a String). Many routines for reading input terminate the result with a null as does an assignment like"
char foo[] = "This is a string.";

All you would need to do to "clear" this string is to assign a null to the first character. For example:
foo[0] = '\0';


15686: <p>Currently I convert the characters in <code>char received[20]</code> to string using <code>String randomString(received)</code> and I am able to display it using <code>Serial.println(randomString)</code>. After displaying the string, I would like to know the easiest way to clear out its contents.</p>
 10907: <p>In C and C++ a null terminated array of characters <strong>is</strong> a string (although not a String). Many routines for reading input terminate the result with a null as does an assignment like"</p>

<pre><code>char foo[] = "This is a string.";
</code></pre>

<p>All you would need to do to "clear" this string is to assign a null to the first character. For example:</p>

<pre><code>foo[0] = '\0';
</code></pre>
