How to compare a string

16 views
Skip to first unread message

Алексей Жихарев

unread,
Jun 15, 2017, 10:31:39 AM6/15/17
to rythmengine
I have an array and I need to check the string from this array for a match.

I want to check the match of my string and build from an array of "names"

@for(name:names){
 
@if( "myString" name  ){
  good
 
} else {
  bad
 
}
}


What should I write in  
@if ("myString" name)

?

In the end, I want to get a select with items from names, and the active item should become one whose name will match the name of the array.


I tried to do so, but I can not (((

@{
 
String str = "John";
}
@for(name:names){
 
@if( @str.equalsIgnoreCase( @name ) ){
  good
 
} else {
  bad
 
}
}

green

unread,
Jun 15, 2017, 5:31:35 PM6/15/17
to rythm...@googlegroups.com
@for (name: names) {
    @if("myString".equals(name)) {
        good
    } else {
        bad
    }
}

--
You received this message because you are subscribed to the Google Groups "rythmengine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rythmengine...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Алексей Жихарев

unread,
Jun 16, 2017, 7:21:48 AM6/16/17
to rythmengine



Thank you 
Reply all
Reply to author
Forward
0 new messages