Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposed revision of string.split() method #5857

Closed
NationalityNZ opened this issue Jun 5, 2022 · 2 comments
Closed

Proposed revision of string.split() method #5857

NationalityNZ opened this issue Jun 5, 2022 · 2 comments
Labels
area:class reference Issues and PRs about the class reference, which should be addressed on the Godot engine repository enhancement

Comments

@NationalityNZ
Copy link
Contributor

NationalityNZ commented Jun 5, 2022

Your Godot version:
Alpha 9

Issue description:

From godotengine/godot#61530

Proposed revision of the string.split() documentation.

 <description> 
 		Returns the slice of the [Array], from [code]begin[/code] (inclusive) to [code]end[/code] (exclusive), as a new [Array]. 
 		The absolute value of [code]begin[/code] and [code]end[/code] will be clamped to the array size, so the default value for [code]end[/code] makes it slice to the size of the array by default (i.e. [code]arr.slice(1)[/code] is a shorthand for [code]arr.slice(1, arr.size())[/code]).
		This means that leaving the end parameter empty will return every element to the right of index. For example, [code][0, 1, 2, 3, 4, 5].slice(3) returns [code][3, 4, 5][/code]
 		If either [code]begin[/code] or [code]end[/code] are negative, they will be relative to the end of the array (i.e. [code]arr.slice(0, -2)[/code] is a shorthand for [code]arr.slice(0, arr.size() - 2)[/code]). Negative and positive indices can be combined, as long as the [code]begin[/code] has a smaller index on the array than [code]end[/code], otherwise an empty array will be returned. For example, [code][0, 1, 2, 3, 4, 5].slice(-4,5) returns [code][1, 2, 3, 4, 5][/code]
 		If specified, [code]step[/code] is the relative index between source elements. In the case of step being negative, then the index of [code]begin[/code] must be higher than [code]end[/code]. For example, [code][0, 1, 2, 3, 4, 5].slice(5, 1, -2)[/code] returns [code][5, 3][/code]).
 		If [code]deep[/code] is true, each element will be copied by value rather than by reference. 
 	</description>

URL to the documentation page (if already existing):

https://docs.godotengine.org/en/latest/classes/class_string.html?highlight=string#class-string-method-split

@Calinou Calinou added the area:class reference Issues and PRs about the class reference, which should be addressed on the Godot engine repository label Jun 5, 2022
@skyace65
Copy link
Contributor

skyace65 commented Jun 6, 2022

You don't need to open a proposal issue. You can just make the PR and the change will be reviewed.

@akien-mga
Copy link
Member

Superseded by godotengine/godot#68838.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:class reference Issues and PRs about the class reference, which should be addressed on the Godot engine repository enhancement
Projects
None yet
Development

No branches or pull requests

4 participants