Skip to content

*.replace(); does not work on Arduino Uno Wifi Rev. 2 #109

Open
@oppaernst

Description

@oppaernst

Hello,

it is not possible for me to get proper results for the following code on all of my Arduino Uno Wifi Rev. 2:

String currentLine = "%2216%22,%20%2217%22";

void setup()
{
  Serial.begin(115200);
  Serial.println(currentLine);
  currentLine.replace("%22","");
  Serial.println(currentLine); 
  currentLine.replace("%20","");
  Serial.println(currentLine);  
  Serial.println("The result should be 16,17 but it is not.");
}

void loop()
{
}

The serial monitor gives me:

%2216%22,%20%2217%22
%2216%22,%20%2217%22
%2216%22,%2217%22

The result (the last Serial.println(currentLine);) should be 16,17 but it is not.

Is there any workaround for this problem?

Kind regards

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions