I am trying to figure out if an array I have, has more than one string associated with it or if it is just a character array (string). Right now if I enter a singular ID of 1234 I will get an array of 1,2,3,4 but if I say there are two ID's 12 and 34 the array will return 12, 34. How would I check for a string when it should always be an array of strings?
<div class="area">
<h2>Select all people who will be Traveling</h2>
<div>
<g:if test="${disabled=='false'}">
<g:select name="selector" class="claim" value="None" from="${fullList}" optionKey="studentID" optionValue="${{it.firstName + ' ' + it.lastName}}" noSelection="${['null':' ']}" disabled="${disabled}"/>
<g:if test="${tripInstance?.student!= null }">
<g:each var="i" in="${(0..<tripInstance?.student?.length) }">
<div>
<input class='field' name='Name' readonly type='text' value='${fullList.firstName[(tripInstance?.student[i]).toInteger()]} ${fullList.lastName[(tripInstance?.student[i]).toInteger()]}'/>
<input class='field' name='student' readonly type='hidden' value='${tripInstance?.student[i]}'/>
<label class='removeEdit fakeLink'> Remove</label>
</div>
</g:each>
</g:if>
</g:if>
<g:if test="${disabled=='true'}">
<g:if test="${tripInstance?.student!= null }">
<g:each var="i" in="${(0..<tripInstance?.student?.size()) }">
<div>
<input class='field' name='student' readonly disabled="${disabled}" type='text' value='${tripInstance?.student[i]}'/>
</div>
</g:each>
</g:if>
</g:if>
</div>
</div>
I have attempted to check based on class. I can't check based on size as a string will have a size and so will an array of strings. It is a string array instead of Int array due to other parts of the code wanting it in this format. Hopefully I'm not overlooking something easy.
1, 234or123, 4or1,2,34or12,3,4? Basically, how do you determine the valid states?