Skip to content

[PORT] Supporting iterate string by split function #687

@tomlm

Description

@tomlm

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions