2. Given the complex number $z$ satisfies $z+|z|=2+\mathrm{i}$. Then $z=$
$\qquad$
2. $\frac{3}{4}+\mathrm{i}$.

Let $z=x+\mathrm{i}(x \in \mathbf{R})$. Then
$$
\begin{array}{l}
x+\mathrm{i}+\sqrt{x^{2}+1}=2+\mathrm{i} \\
\Rightarrow x+\sqrt{x^{2}+1}=2 \Rightarrow x=\frac{3}{4} \\
\Rightarrow z=\frac{3}{4}+\mathrm{i}
\end{array}
$$