user72815: I use bluetooth (works like serial monitor).
Let me say i send a text to my hc-05 (same as sending to serial monitor)
My current code is displaying text from serial monitor/HC-05 TO LCD
#include <LiquidCrystal.h>

LiquidCrystal lcd(4, 6, 10, 11, 12, 13);
String readString;

void setup() {
  Serial.begin(9600);
  lcd.begin(16, 2);
}

void loop() {
  while(Serial.available()){
    delay(50);
    char c=Serial.read();
    readString+=c;
  }
  if(readString.length()>0){
    Serial.println(readString);
      lcd.clear();
      lcd.print(readString);
    readString="";
  }
}

from serial monitor i type `a,b,c,d`


now my goal is to just get the a and display in lcd

or

in other words i want to get the value of a b c d in the text that is CSV to list or array and get value for index 1,2,3,4

OR

split string by delimiter

so how can i do it
details-ARUINO UNO

user72815: i searched in stack exchange Arduino but i dint get answer so i posted but when i searched in stack over flow i got link this is my final code
String part01;
String getValue(String data, char separator, int index)
{
  int found = 0;
  int strIndex[] = {0, -1};
  int maxIndex = data.length()-1;

  for(int i=0; i<=maxIndex && found<=index; i++){
    if(data.charAt(i)==separator || i==maxIndex){
        found++;
        strIndex[0] = strIndex[1]+1;
        strIndex[1] = (i == maxIndex) ? i+1 : i;
    }
  }

  return found>index ? data.substring(strIndex[0], strIndex[1]) : "";
}

void setup()
{
  Serial.begin(9600);
}

void loop()
{
  String part01 = getValue("523;524;525",';',1);
  Serial.println(part01);

}


user31105: Use the strtok function.
From Geeks for geeks (https://www.geeksforgeeks.org/strtok-strtok_r-functions-c-examples/):
arguments:

str: The string which is to be split
delim: The character on the basis of which the split will be done Return value

The function performs one split and returns a pointer to the token split up. A null pointer is returned if the string cannot be split.

72815: <p>I use bluetooth (works like serial monitor).
Let me say i send a text to my hc-05 (same as sending to serial monitor)
My current code is displaying text from serial monitor/HC-05 TO LCD</p>
<pre><code>#include &lt;LiquidCrystal.h&gt;

LiquidCrystal lcd(4, 6, 10, 11, 12, 13);
String readString;

void setup() {
  Serial.begin(9600);
  lcd.begin(16, 2);
}

void loop() {
  while(Serial.available()){
    delay(50);
    char c=Serial.read();
    readString+=c;
  }
  if(readString.length()&gt;0){
    Serial.println(readString);
      lcd.clear();
      lcd.print(readString);
    readString=&quot;&quot;;
  }
}
</code></pre>
<pre><code>from serial monitor i type `a,b,c,d`
</code></pre>
<blockquote>
<p>now my goal is to just get the a and display in lcd</p>
</blockquote>
<p>or</p>
<blockquote>
<p>in other words i want to get the value of a b c d in the text that is CSV to list or array and get value for index 1,2,3,4</p>
</blockquote>
<p>OR</p>
<blockquote>
<p><em><strong>split string by delimiter</strong></em></p>
</blockquote>
<p>so how can i do it</p>
<p>details-ARUINO UNO</p>
 72815: <p>i searched in stack exchange Arduino but i dint get answer so i posted but when i searched in stack over flow i got <a href="https://stackoverflow.com/a/29673158/14862885">link</a> this is my final code</p>
<pre><code>String part01;
String getValue(String data, char separator, int index)
{
  int found = 0;
  int strIndex[] = {0, -1};
  int maxIndex = data.length()-1;

  for(int i=0; i&lt;=maxIndex &amp;&amp; found&lt;=index; i++){
    if(data.charAt(i)==separator || i==maxIndex){
        found++;
        strIndex[0] = strIndex[1]+1;
        strIndex[1] = (i == maxIndex) ? i+1 : i;
    }
  }

  return found&gt;index ? data.substring(strIndex[0], strIndex[1]) : &quot;&quot;;
}

void setup()
{
  Serial.begin(9600);
}

void loop()
{
  String part01 = getValue(&quot;523;524;525&quot;,';',1);
  Serial.println(part01);

}
</code></pre>
 31105: <p>Use the <code>strtok</code> function.</p>
<p>From Geeks for geeks (<a href="https://www.geeksforgeeks.org/strtok-strtok_r-functions-c-examples/" rel="nofollow noreferrer">https://www.geeksforgeeks.org/strtok-strtok_r-functions-c-examples/</a>):</p>
<p>arguments:</p>
<ul>
<li>str: The string which is to be split</li>
<li>delim: The character on the basis of which the split will be done Return value</li>
</ul>
<p>The function performs one split and returns a pointer to the token split up. A null pointer is returned if the string cannot be split.</p>
