Note that when without the condition $u(0,t)=0$ this is in fact a just-determining problem and the solution can be expressed by using D’Alembert’s formula $u(x,t)=\dfrac{\varphi(x+t)+\varphi(x-t)}{2}+\dfrac{1}{2}\int_{x-t}^{x+t}\psi(s)~ds$ , where $\varphi(s)$ and $\psi(s)$ are any functions that satisfly $\varphi(0)=\psi(0)=0$ .
Since $\dfrac{\varphi(t)+\varphi(-t)}{2}+\dfrac{1}{2}\int_{-t}^t\psi(s)~ds$ does not necessarily equal to $0$ , so when with the condition $u(0,t)=0$ this becomes an overdetermining problem. Therefore the solution should be classified into two cases:
Case $1$: $\dfrac{\varphi(t)+\varphi(-t)}{2}+\dfrac{1}{2}\int_{-t}^t\psi(s)~ds=0$
$u(x,t)=\dfrac{\varphi(x+t)+\varphi(x-t)}{2}+\dfrac{1}{2}\int_{x-t}^{x+t}\psi(s)~ds$ , where $\varphi(s)$ and $\psi(s)$ are any functions that satisfly $\varphi(0)=\psi(0)=0$
Case $2$: $\dfrac{\varphi(t)+\varphi(-t)}{2}+\dfrac{1}{2}\int_{-t}^t\psi(s)~ds\neq0$
Piecewise solution should be unavoiable. The trick in http://eqworld.ipmnet.ru/en/solutions/lpde/lpde201.pdf should be used:
$u(x,t)=\begin{cases}\dfrac{\varphi(x+t)+\varphi(x-t)}{2}+\dfrac{1}{2}\int_{x-t}^{x+t}\psi(s)~ds&\text{when}~x>t\\\dfrac{\varphi(x+t)-\varphi(t-x)}{2}+\dfrac{1}{2}\int_{t-x}^{x+t}\psi(s)~ds&\text{when}~x , where $\varphi(s)$ and $\psi(s)$ are any functions that satisfly $\varphi(0)=\psi(0)=0$