简体   繁体   中英

String.contains() in Flex?

Do you know if Flex have a method like Contains() to find a word in a String???

I´d like to do something like this:

       for (int x = 0; x < Concepto.length; x++) {
        if(cadena.contains(id[x])){

            System.out.println("ID ya agregado...");
        }
        else{
            cadena += "\n id=  " + id[x];
        }
        for (int y = 0; y < Concepto.length; y++) {



            if (id[x].equals(id[y])) {
            if(cadena.contains(Concepto[y])){
                    System.out.println("Concepto ya agregado...");
            }else{
                cadena += "\n" + Concepto[y];
            }

            }else {
                System.out.println("No se agrega...");
            }


        }

使用indexOf方法

if(cadena.indexOf(Concepto[y]) > -1)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM