Skip to content
Reference > Methods

strCut(text,delim,fieldList)

Definition

String strCut(String text, String delim, String fieldList)

Description

Splits the line into a list using the supplied delimiter and returns those fields listed by position. Returns the joined strings using the supplied delim.

Parameter Definition

Name Type Description
text String The string to split
delim String delimiter, literal not a pattern
fieldList String fields to return, Can use n-m for range; n,m,... for individual fields or -n for first number or n- for last n entries

Examples

1
2
3
4
5
String r1 = strCut("these are some words"," ","2-3"); // r1 == some words
String r2 = strCut("these are some words"," ","1,3,5"); // r2 == are words
String r3 = strCut("these are some words"," ","-2"); // r3 == these are some
String r4 = strCut("these are some words"," ","3-"); // r4 == words
String r5 = strCut("these are some words"," ","3-1,3"); // r5 == words some are words