Search code examples
eiffel

Eiffel: percent character into a string


How do I concatenate a percent % string to a string?

as either do not work

s := "%%" + s + "%" 

I know its a special character but don't afford it neither do I find the doc...

UPDATE

The answer was one of my attempts, but it could stay an issue of the compiler/editor. After putting the example into the same feature, compiling, and replacing the old code the compiler did not complain anymore, but still stays as syntax coloration strange

enter image description here


Solution

  • Using the same double-percent string in the second case should do the trick:

    s := "%%" + s + "%%"