# Iterate over string

**URL:** https://www.finalbuilder.com/forums/t/iterate-over-string/3756
**Category:** Feature Requests
**Created:** [November 14, 2006, 3:59am UTC](https://www.finalbuilder.com/forums/t/iterate-over-string/3756 "2006-11-14T03:59:13Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![stevage](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/s/bc8723/32.png) [@stevage](https://www.finalbuilder.com/forums/u/stevage)
#### Post date: [November 14, 2006, 3:59am UTC](https://www.finalbuilder.com/forums/t/iterate-over-string/3756/1 "2006-11-14T03:59:13Z")

</div>

Suggestion: extend the “List Iterator” to allow iteration over a string with some defined delimiter. The main advantage of course is that you can store a string in a variable, so this would mean you could store a _list_ in a variable, for free.  
  
Concrete use: wanting to recreate the same set of directories in various places. Sets of directories don’t (if I understand correctly) count as FileSets.

---

<div class="post-metadata">

### Author: ![tate](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/t/e19b73/32.png) [@tate](https://www.finalbuilder.com/forums/u/tate)
#### Post date: [November 14, 2006, 4:13am UTC](https://www.finalbuilder.com/forums/t/iterate-over-string/3756/2 "2006-11-14T04:13:52Z")

</div>

Hi Steve,  
  
You can sortof already do this, because a variable can be multi-line. So, to build up your variable you can do this in script:  
MyVar = MyVar & vbCR & vbLF  
  
Then in the list iterator action you can just set the list to %MyVar% and it will iterate for each line in the string.  
  
hth.  
.t8

---

<div class="post-metadata">

### Author: ![stevage](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/s/bc8723/32.png) [@stevage](https://www.finalbuilder.com/forums/u/stevage)
#### Post date: [November 14, 2006, 7:12am UTC](https://www.finalbuilder.com/forums/t/iterate-over-string/3756/3 "2006-11-14T07:12:04Z")

</div>

Ah, thanks, good thinking!  
  
Steve

---

<div class="post-metadata">

### Author: ![stevage](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/s/bc8723/32.png) [@stevage](https://www.finalbuilder.com/forums/u/stevage)
#### Post date: [November 17, 2006, 12:02pm UTC](https://www.finalbuilder.com/forums/t/iterate-over-string/3756/4 "2006-11-17T12:02:37Z")

</div>

Hey, it turns out to be even easier if you use F2 to construct the original variable value…  
  
Steve
