Issue Details (XML | Word | Printable)

Key: NAWSAKABRAZIL-1
Type: Bug Bug
Status: Resolved Resolved
Resolution: Won't Fix
Priority: Minor Minor
Assignee: sauhler
Reporter: digitalrinaldo
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
nawsakabrazil

foreach loop with delim does not provide null elements

Created: 14/Mar/10 12:11 AM   Updated: 06/Oct/10 01:07 AM   Resolved: 06/Oct/10 01:07 AM
Component/s: None
Affects Version/s: None
Fix Version/s: None

Time Tracking:
Not Specified

Tags:


 Description  « Hide

<foreach name=p list="a||B">
<get name=p>
</foreach

returns a,B not a,,B



moo added a comment - 04/Jun/10 02:39 PM

The above example (assuming the > is added to the </foreach) should return the single value "a||B". Please correct the example so the problem is reproducable


digitalrinaldo added a comment - 09/Jun/10 05:46 AM

<foreach name=p list="a||B" delim="|">
1
</foreach

produces 11 as output


moo added a comment - 16/Jun/10 05:28 AM

Work around:

Use: <foreach name=i list="A||B" delim="[|]"> ...

Using a single character delimeter uses StringTokenizer(), which collapsed multiple delimiters.
Multiple character delimiters are always interpreted as regular expressions, and empty
values are returned properly


digitalrinaldo added a comment - 06/Oct/10 01:07 AM

A work around was proposed