An initial pulse with fairly steep fronts whose evolution is described by the nonlinear Schrodinger equation, splits into soliton-like pulses (spontaneous soliton formation). The number of solitons formed in this process can be estimated by the number of spectral points of the associated linear Zakharov-Shabat problem for the initial pulse. Exact solutions of the Zakharov-Shabat problem are constructed for some classes of initial piecewise-continuous pulses by using the Darboux method. This allows us to estimate the effect of the shape of the initial pulse on the number of formed solitions and their parameters.