5. In $\triangle A B C$, $A C=2, B C=3, \angle A C B$ $=90^{\circ}, C D$ is the angle bisector of $\angle A C B$, and the right triangle is folded along $C D$ to form a right dihedral angle $A^{\prime}-C D-$
$B$. Then the distance between $A^{\prime}$ and $B$ is . $\qquad$
5. $\sqrt{7}$.

Since $A^{\prime}-C D-B$ 
is a right dihedral angle, i.e., plane $A^{\prime} C D$ 
$\perp$ plane $B C D$. We have $\angle A^{\{\prime}} C D$ 
$$
=45^{\circ}, \angle B C D=45^{\circ} \text {. }
$$

From $\cos \angle A^{\prime} C D=\cos \angle A^{\prime} C D \cdot \cos \angle B C D$, 
we get $\cos \angle A^{\prime} C B=\frac{\sqrt{2}}{2} \times \frac{\sqrt{2}}{2}=\frac{1}{2}$.
Applying the cosine rule in $\triangle A^{\prime} C B$, we get
$$
\begin{aligned}
A^{\prime} B^{2} & =A^{\prime} C^{2}+B C^{2}-2 A^{\prime} C \cdot B C \cdot \cos \angle A^{\prime} C B \\
& =2^{2}+3^{2}-2 \times 2 \times 3 \cos 60^{\circ} \\
& =7 . \\
\therefore A^{\prime} B & =\sqrt{7} .
\end{aligned}
$$