Skip to content
Reference > Methods

strStrip(text,prefix,suffix)

Definition

String strStrip(String text, String prefix, String suffix)

Description

Returns the substring of supplied text with the prefix and suffix removed. If the string doesn't start with the specified prefix, then the prefix is ignored. If the string doesn't end with suffix, then the suffix is ignored.

Parameter Definition

Name Type Description
text String The text to use as base for return value
prefix String The prefix to strip from beginning of base text
suffix String The suffix to strip from end of base text

Examples

1
2
3
String r1 = strStrip("What is Going On","What","On"); // r1 ==  is Going 
String r2 = strStrip("WhatOn","What","On"); // r2 == 
String r3 = strStrip("When are we on","What","On"); // r3 == When are we on