cleanTextForTranslate
La función cleanTextForTranslate permite limpiar un string para poder traducirlo.
Importación
Para importar el componente cleanTextForTranslate, se puede hacer desde fenextjs
import { cleanTextForTranslate } from "fenextjs";Parámetros
| Parámetro | Tipo | Requerido | Default | Descripcion |
|---|---|---|---|---|
| text | string | sí | Texto a tranducir. |
Returns
| Parametro | Tipo | Descripcion |
|---|---|---|
| text | string | Texto Limpio para traducir. |
Usos
- Limpiar espacios
cleanTextForTranslate("Text Text2"); // Retorna "Text Text2"- Limpiar espacios iniciales o finales
GetCardType(" Text "); // Retorna "Text"- Limpiar saltos de linea
cleanTextForTranslate("Text \n Text2"); // Retorna "Text Text2"