Skip to content

EnsureProperUseOfDotNetMethods\split recommendation alternative #3

@iRon7

Description

@iRon7

Recommendation: The Split method behaves differently between PS5 and PS7 due to .NET changes. Use -split or -csplit with regex instead.

A closer alternative (that doesn't use regular expressions) would be using the ToCharArray method:

 'Test1;Test2'.Split(',;|'.ToCharArray())
Test1
Test2

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