A novel approach to string constraint solving