Remove "end" in algorithm2e

For that you should add noend option when declaring the package:

\usepackage[noend]{algorithm2e}

This is entirely covered in the algorithm2e documentation (section 10.4 if-then-else macros), and is provided by \lIf (short for line If):

enter image description here

\documentclass{article}
\usepackage{algorithm2e}
\newcommand{\True}{\textbf{true}}
\begin{document}
\begin{algorithm}[H]
  \SetAlgoLined
  \KwData{this text}
  \KwResult{how to write algorithm with \LaTeX2e }
  initialization\;
  \While{not at end of this document}{
    read current\;
    \eIf{understand}{
      go to next section\;
      current section becomes this one\;
    }{
      go back to the beginning of current section\;
    }
    \lIf{condition}{\Return{} \True}
  }
  \caption{How to write algorithms}
\end{algorithm}

\end{document}

Tags:

Algorithm2E