This shows you the differences between two versions of the page.
es:explodex [2016/01/01 22:43] |
es:explodex [2020/02/28 10:46] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ===== Explodex ===== | ||
+ | |||
+ | ==== Formato ==== | ||
+ | VariableArraydeCadenas$ = **explodex** ( //cadena// , //ExpReg// )\\ | ||
+ | VariableArray = **explodex** ( //cadena// , //ExpReg// ) | ||
+ | |||
+ | ==== Descripción ==== | ||
+ | Divide //cadena// en subcadenas, determinadas por la expresión regular //ExpReg//. Las subcadenas se almacenarán bien en un array de cadenas, o bien en un array numérico, según como se asigne la función. El array será redimensionado al tamaño exacto para almacenar todas las subcadenas. | ||
+ | |||
+ | ==== Ejemplo ==== | ||
+ | < | ||
+ | # dividir con el separador //[,]* // | ||
+ | a$ = "We all live in a yellow submarine, yellow submarine, yellow, submarine." | ||
+ | w$ = explodex(a$," | ||
+ | for t = 0 to w$[?]-1 | ||
+ | print " | ||
+ | next t | ||
+ | |||
+ | # dividir con el separador // | ||
+ | a$="1 and 2 AND 3 and 5 aND 99 AND 8.88 aNd 6.45" | ||
+ | n = explodex(a$," | ||
+ | for t = 0 to n[?]-1 | ||
+ | print " | ||
+ | next t | ||
+ | </ | ||
+ | mostrará: | ||
+ | < | ||
+ | We all live in a yellow submarine. | ||
+ | w$[0]=We | ||
+ | w$[1]=all | ||
+ | w$[2]=live | ||
+ | w$[3]=in | ||
+ | w$[4]=a | ||
+ | w$[5]=yellow | ||
+ | w$[6]=submarine | ||
+ | w$[7]=yellow | ||
+ | w$[8]=submarine | ||
+ | w$[9]=yellow | ||
+ | w$[10]=submarine. | ||
+ | n[0]=1 | ||
+ | n[1]=2 | ||
+ | n[2]=3 | ||
+ | n[3]=5 | ||
+ | n[4]=99 | ||
+ | n[5]=8.88 | ||
+ | n[6]=6.45 | ||
+ | </ | ||
+ | |||
+ | ==== Disponible desde la versión ==== | ||
+ | 0.9.6.56 | ||