Show Posts
Pages: [1]
1  Using Arduino / Programming Questions / Re: Eliminate spaces, string.replace() and .trim() not possible? on: February 17, 2012, 09:32:14 am
many thanks for the information!

works fine now  smiley
2  Using Arduino / Programming Questions / Eliminate spaces, string.replace() and .trim() not possible? on: February 17, 2012, 05:58:04 am
Hello good day Arduino communiy!

I allways got an error while compiling with the String- .trim() or .replace() function.

I`ve also tried some example code:
Code:
String stringOne = "<html><head><body>";
Serial.println(stringOne);
String stringTwo = stringOne.replace("<", "</");
Serial.println(stringTwo);


While compiling the sample source (Arduino v1.0) 8. Strings -> StringReplace:

Quote
StringReplace.cpp: In function 'void loop()':
StringReplace:22: error: conversion from 'void' to non-scalar type 'String' requested
StringReplace:28: error: conversion from 'void' to non-scalar type 'String' requested
StringReplace:29: error: no match for 'operator=' in 'leetString = leetString.String::replace('e', '3')'
C:\Users\...\Documents\Arduino\arduino-1.0\hardware\arduino\cores\arduino/WString.h:83: note: candidates are: String& String::operator=(const String&)
C:\Users\...\Documents\Arduino\arduino-1.0\hardware\arduino\cores\arduino/WString.h:84: note:                 String& String::operator=(const char*)

Thanks in advance
Best regards,

Micha
Pages: [1]