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

[PORT] Supporting iterate string by split function #1656

Closed
tomlm opened this issue Feb 3, 2020 · 0 comments · Fixed by #1661
Closed

[PORT] Supporting iterate string by split function #1656

tomlm opened this issue Feb 3, 2020 · 0 comments · Fixed by #1661
Assignees

Comments

@tomlm
Copy link
Contributor

tomlm commented Feb 3, 2020

Port this change from botbuilder-dotnet/master branch:
microsoft/botbuilder-dotnet#3328

closes #3279

Now split function can take a single parameter:
split('hello'), new string[] { "h", "e", "l", "l", "o" }

Also if the seperator is a null, it will return same result as the seperator is string.Empty. If both input string and seperator are string.Empty or null, it will return a empty string array.
split('hello',''), new string[] { "h", "e", "l", "l", "o" }
split('',''), new string[] { }
split('hello',nullObj), new string[] { "h", "e", "l", "l", "o" }

If the input string is null, it will return string.Empty regardless the content of the non-empty seperator.
split(nullObj,'e')", new string[] { string.Empty }

Changed projects

  • Microsoft.Bot.Expressions
  • Microsoft.Bot.Expressions.Tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants