-->
Page 1 of 1

Using F() with R"()" for saving raw strings to flash

PostPosted: Thu Feb 22, 2018 1:36 pm
by svefro
Anybody know how to use F() or PSTR() with R"()" for multiline raw strings?

i have some html that i use in my esp project that i have saved globaly with PROGMEM
Code: Select allconst char FPSTR_html_gui[] PROGMEM = R"(
         <div>Some HTML Here</div>
      )";


However i also have alot og inline html that i want to save within functions

I have tried using
Code: Select allString html = "";
html += F(R"(
<div class="row">
   <div class="col-sm-12">
         text here
      </div>
</div>
)");

But this gives all sorts of compile errors when i break the strings in to lines in the source code.
The code below works fine but makes the html difficult to read:
Code: Select allString html = "";
html += F(R"(<div class="row"><div class="col-sm-12">text here</div></div>)");



anybody know how to use F() with multiline RAW Strings using R"()"?