How to sort the word which has a dot . and paranthesis() using powershell

Welcome Forums General PowerShell Q&A How to sort the word which has a dot . and paranthesis() using powershell

This topic contains 2 replies, has 2 voices, and was last updated by

 
Participant
4 weeks ago.

  • Author
    Posts
  • #172450

    Participant
    Topics: 4
    Replies: 9
    Points: 28
    Rank: Member

    I want to sort out all the words which has the below structure :

    .getMethod(param);

    .getMethod1();

    ...

    The structure is a . dot followed by word which is followed by () paranthesis and ; semicolon.

  • #172483

    Participant
    Topics: 9
    Replies: 423
    Points: 676
    Helping Hand
    Rank: Major Contributor
    $WordList = @(
        '.getMethod(param);'
        '.getMethod1();'
        '.putthis(that);'
        '.getthis();'
        '.getthis(that);'
    )
    $WordList | sort 
    
    • #172492

      Participant
      Topics: 4
      Replies: 9
      Points: 28
      Rank: Member

      Thanks Sam . Will give it a try .

You must be logged in to reply to this topic.