> For the complete documentation index, see [llms.txt](https://gitbook.testingwaters.in/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gitbook.testingwaters.in/lists/replace-recurring.md).

# Replace Recurring

![](/files/-Lg--_2C8z2X5r6NPBmb)

```d
def rep(a:var[])
{
	return = [Imperative]
	{
		b = 0;
		c = [];
		e = 1;
		for(d in a)
		{
			if(d == "unoccupied")
			{
				c[b] = String.PadLeft(e+"",2,"0");
				b = b+1;
				e = e + 1;
			}
			else
			{
				c[b] = d;
				b = b + 1;
			}
		}
		return c;
	}
};
```
