replaceAll
Last update: April 7, 2025
- Topics:
- Journeys
CREATED FOR:
- Experienced
- Developer
Replaces all occurrences matching the target string by the replacement string in the base string.
The replacement proceeds from the beginning of the string to the end, for example, replacing “aa” with “b” in the string “aaa” will result in “ba” rather than “ab”.
Category
String
Function syntax
replaceAll(<parameters>)
Parameters
Parameter | Type |
---|---|
base | string |
target | string (RegExp) |
replacement | string |
Signature and returned type
replaceAll(<baseString>,<sourceString>,<replacementString>)
Returns a string.
Example
replaceAll("Hello World", "l", "x")
Returns “Hexxo Worxd”.
Because the target parameter is a RegExp, depending on the string you want to replace, you may need to escape some characters. Refer to the example on this page.
Previous pagereplace
Next pagesplit
Journey Optimizer
- Journey Optimizer documentation
- What’s new?
- Get started
- Journeys
- Get started with journeys
- Create a journey
- Manage your journeys
- Browse & filter your journeys
- Profile entrance in journeys
- Supplemental identifier in event-triggered journeys
- Time zone management
- Send-Time optimization
- End your journey
- Copy a journey to another sandbox
- Troubleshoot your journey
- Troubleshoot inbound actions in journeys
- Integrate with Intelligent Services
- Activities
- Build expressions
- Use cases
- Learn through use cases
- Experience event lookup
- Send multi-channel messages
- Send a message using Campaign v7/v8
- Send a message to subscribers
- Pass collections dynamically using custom actions
- Limit throughput with external data sources & custom actions
- Use custom actions to write journey events in Experience Platform
- Campaigns
- Conflict management & prioritization
- Test & approve
- Communication channels
- Get started with communication channels
- Email channel
- In-app channel
- Push notification channel
- SMS / MMS / RCS channel
- Direct mail
- Web channel
- Code-based experience
- Content cards
- LINE
- Content management
- Landing pages
- Personalization
- Content templates
- Reusable content fragments
- Dynamic content
- Cross-solution use cases
- AI Assistant for content generation
- Multilingual content
- Content experiment
- Audiences, profiles & identity
- Reporting
- Get started with reports
- Live report
- All time report
- Custom journey reports
- Decision capabilities
- Get started with decision capabilities
- Decisioning
- Get started with Decisioning
- Decisioning guardrails & limitations
- API reference
- Manage decision items
- Configure item selection
- Create selection strategies
- Create decision policies
- Report on Decisioning
- Decisioning use case
- Decision management
- Get started with Decision management
- Create components
- Create rankings
- Create & manage offers
- Create & manage decisions
- Use batch decisioning
- Collect event data
- Leverage context data
- Create Decision Management reports
- Export your offer catalog
- API Reference
- Getting started
- Create & manage offers using APIs
- Deliver offers using APIs
- Data management
- Channel configuration
- Journey configuration
- Connect your systems and environments
- Access control
- Privacy