Report bug... WString Replace("xxx","yyy")

I.

please replace this line in the WString.h file

void replace(const String& find, const String& replace); by void replace(const String &find, const String &replace);

Tanks...

They're the same thing to the compiler, and the version used looks nicer.

They're the same thing to the compiler, and the version used looks nicer.

I'll agree with the first half of your statement, but I prefer the * and & to go with the variable, not the type.

int* a, b; looks like the type is int* for both a and b, but it isn't. a is an int pointer, but b is an int.

int *a, b; makes it clear that the type is int, and that a is a pointer while b isn't.

In my opinion.

I.
Probably it works with another complier.

by the way, the example “string remove” also need correction. replace return void…

/*
  String replace()
 
 Examples of how to replace characters or substrings of a string
 
 created 27 July 2010
 by Tom Igoe
 
 http://arduino.cc/en/Tutorial/StringReplace
 
 This example code is in the public domain. 
 */

void setup() {
  Serial.begin(9600);
  Serial.println("\n\nString  replace:");
}

void loop() {
  String stringOne = "<html><head><body>";
  Serial.println(stringOne);
  // replace() changes all instances of one substring with another:
  stringOne.replace("<","</");
  String stringTwo = stringOne;
  Serial.println(stringTwo);

  // you can also use replace() on single characters:
  String normalString = "bookkeeper";
  Serial.println("normal: " + normalString);
  normalString.replace('o', '0');
  String leetString = normalString;
  leetString.replace('e', '3');
  leetString = leetString;
  Serial.println("l33tspeak: " + leetString);

  // do nothing while true:
  while(true);
}