We study the exponential stability of a class of nonlinear switching systems and the asymptotical stability of a class of nonlinear switching systems with time-delay using the Karush-Kuhn-Tucker (KKT) condition for nonlinear optimal programming problems.