Create longest substring