substring

Synopsis

string substring(string inputString, float startPos, float endPos)

Returns

Substring of inputString, extracted between indices startPos and endPos (endPos excluded).

This function returns a substring of the of the inputString, starting at the index startPos and ending WITHOUT the character at index endPos. (endPos excluded)

Note: The indices startPos and endPos are 0-based.

Related

Examples

example.1
	substring("0123456789", 0, 5)
	# result = "01234"

example.2
	substring("0123456789", 2, 5)
	# result = "234"
	
example.3
	substring("0123456789", -20, 5) # startPos < 0
	# result = "01234"

example.4
	substring("0123456789", 0, 20)	# endPos >= len(inputString)
	# result = "0123456789"
	
example.5
	substring("0123456789", 5, 0)	# startPos >= endPos
	# result = ""

Copyright ©2008-2017 Esri R&D Center Zurich. All rights reserved.