Goto main content

wstrsub

Returns a substring from the original string.

WSTRSUB

NAME

wstrsub - Returns a substring from the original string.

SYNOPSIS

wstrsub([start:integer, finish:integer, endblank:boolean], "string");

DESCRIPTION

This program allows the user to extract a part of the string chosen at start. It will start at "position start" and end at "position finish". For example, if your "ps" is 2, it will start to extract from the second character of the string.

If the "endblank" is true, the program will run until it reaches a blank character.

This program works on wide character while strsub works on single byte character.

EXAMPLES

Note: In the followings examples, the _ between the { should be removed to make it work.

res={_{strsub(start:2,"pierre")}}. return res=erre.
res={_{strsub(start:2,"pierre","laplante")}}. return res=erreplante.
res={_{wstrsub(start:2,"péerre")}}. return res=erre.
res={_{wstrsub(finish:4,"péerre")}}. return res=péerr.
res={_{wstrsub(start:2,finish:4,"péerre")}}. return res=err.
res={_{wstrsub(start:2,finish:4,endblank:true,"péereeêrsa      abc")}}. return res=ereeêrsa.
res={_{strsub(start:2,finish:4,endblank:true,"peereeersa      abc")}}. return res=ereeersa.

SEE ALSO

{{ include("includes/strings.sn") }}

AUTHOR

Written by Pierre Laplante and Caroline Laplante, <laplante@sednove.com>

MODIFICATIONS

1.0 2014-09-09 21:24:14 laplante@sednove.com

Edit

© 2024 extenso Inc. All rights reserved.