# StringMap()

Iterates over every entry of the string and calls the closure function to work on the element of the string.

**Introduced:** 6.0.0.105

```
StringMap( string=string, closure=function );
```

**Returns:** string

# Arguments

| Argument | Type | Required | Description | Default |
|----------|------|----------|-------------|---------|
| string | string | Yes | Input string. *Alias: inputString, object* |  |
| closure | function | No | Closure or a function reference that will be called for each of the iteration. *Alias: callback* |  |

# Usage Notes

Since Lucee 6, this function iterates over each character in the string.

For list-based iteration with delimiters, use [ListMap()](listmap.md) instead.

[LDEV-3747](https://luceeserver.atlassian.net/browse/LDEV-3747)

# Examples

```1
   myString="Hello World";
      closure=function(val){
      return (val & 'a')
   }
   writeDump(StringMap(myString,closure));
```







# Categories

[Strings](../../categories/string.md)

# See Also

[string.map()](../objects/string/map.md)