Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I escape '%' character in a gettext string?

I use gettext to translate my user interface. I'd like to write symbol % as part of a UI caption in a string, but since it has a special meaning, does not works as expected. How can I escape percent symbols?

like image 816
viam0Zah Avatar asked Sep 16 '10 15:09

viam0Zah


People also ask

How do I escape a character from a string?

\ is a special character within a string used for escaping. "\" does now work because it is escaping the second " . To get a literal \ you need to escape it using \ .

What is Escape character PHP?

In PHP, an escape sequence starts with a backslash \ . Escape sequences apply to double-quoted strings. A single-quoted string only uses the escape sequences for a single quote or a backslash. Here are some common escape sequences for double-quoted strings: \" for a double quote.


1 Answers

Use %% to escape %.

like image 80
bialix Avatar answered Sep 18 '22 13:09

bialix