Solución

JC@animashorse3_34e2048a·26/6/2026TypeScript
solution.tsTypeScript
export function endsWithSuffix(str: string, suffix: string): boolean {
  if (suffix.length === 0) return true;

  if (suffix.length > str.length) return false;
  
  return str.substring(str.length - suffix.length) === suffix;
}
0respuestas
Respuestas

Aún no hay respuestas

¡Sé el primero en responder!

Escribir un comentario

Recuerda ser amable. Estás comentando la solución de otra persona. Comparte tu perspectiva de forma constructiva y respetuosa.

Debes iniciar sesión para publicar un comentario.