I want to use \lstinline
for displaying inline source code in text. This code can contain various characters from different programming languages. For example
while{$a || $b}
This text doesn't work in any of these forms because it contains start/end character of lstinline.
\documentclass{article}
\usepackage{listings}
\begin{document}
% works
\lstinline|while{$a && $b}|
% doesn't work
\lstlinline{while{$a || $b}}
\lstlinline|while{$a || $b}|
\lstlinline$while{$a || $b}$
\end{document}
I am looking for universal solution for multiple languages so there are many characters I can't use in this case (!, ^, ., {, |, etc...).
Is that possible with lstinline? If not, is there any good alternative? Thanks.