Devuelve el índice dentro del objeto String que realiza la llamada de la primera ocurrencia del valor especificado, o -1 si no lo encuentra.
Returns the index within the calling String object of the first occurrence of the specified value, or -1 if not found.
El método slice del objeto String elimina un número de caracteres especificado (en este caso, 5) de la instancia del número de pieza, de modo que solo aparece el número de la pieza.
The slice method of the String object removes a specified number of characters (in this case, 5) from the piece number's instance, so that just the number of the piece appears.
Obtiene el número de caracteres del objeto String actual.
Lo que sigue es la manera de crear una instancia del objeto String
As we have seen, following is the way to create an instance of Array object
Quita todos los caracteres de espacio en blanco del principio y el final del objeto String actual.
Removes all trailing occurrences of a set of characters specified in an array from the current String object.
Longitud Obtiene el número de caracteres del objeto String actual.
Gets the rank (number of dimensions) of the Array.
El método lastIndexOf() devuelve la posición (índice) en la que se encuentra el valorBusqueda, dentro del objeto String que realiza la llamada, de la última ocurrencia del valor especificado; o -1 si no se halla.
The indexOf() method returns the index within the calling String object of the first occurrence of the specified value, starting the search at fromIndex. Returns -1 if the value is not found.
Es posible llamar cualquiera de los métodos del objeto String en un valor literal de cadena-JavaScript automáticamente convierte el literal de cadena a un objeto String temporal, invoca el método, y luego descarta el objeto String temporal.
You can call any of the methods of the String object on a string literal value-JavaScript automatically converts the string literal to a temporary String object, calls the method, then discards the temporary String object.
Puedes utilizar cualquiera de los métodos del objeto String en un literal de tipo string-JavaScript automáticamente convierte el literal string en un objeto String de manera temporal, llama al método, y finalmente destruye el objeto temporal de tipo String.
You can call any of the methods of the String object on a string literal value-JavaScript automatically converts the string literal to a temporary String object, calls the method, then discards the temporary String object.
Conținut posibil inadecvat
Exemplele au rolul de a te ajuta să traduci cuvinte sau expresii corect si adaptat la context. Nu sunt selectate sau validate manual, așadar pot conține termeni inadecvați. Te rugăm să raportezi exemplele pe care le consideri inadecvate. Traducerile vulgare sau colocviale sunt în general marcate cu roșu sau cu portocaliu.
Înregistrează-te pentru a accesa mai multe exemple