• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Custom IC SKILL
  3. Please tell me how to sorting string

Stats

  • Locked Locked
  • Replies 1
  • Subscribers 143
  • Views 2916
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Please tell me how to sorting string

HJC
HJC over 1 year ago

Hello.

I have a question for SKILL Language, so i write this post.

I want to know about how to sorting string list.

In string list, i want to sorting the strings with first word 's'

please refer to the example

------------------------------------------------------------------------------------------------------------------------------------------------------------------------

[example]

list_a = "sun, ssd, abc, drain, swim" <---- i want to sorting "sun, ssd, swim" , and then list-up to the variable "list b"

list_b ==> "sorted string"

------------------------------------------------------------------------------------------------------------------------------------------------------------------------

  • Cancel
Parents
  • Andrew Beckett
    Andrew Beckett over 1 year ago

    If you just want to filter the values (that might be what you mean by "sorted", it wasn't clear):

    list_b = buildString(pcreMatchList("^s" parseString(list_a ", ")) ", ")

    if you want them sorted too:

    list_b = buildString(sort(pcreMatchList("^s" parseString(list_a ", ")) 'alphalessp) ", ")

    The trick is to parse the string into a list, filter with a regular expression, sort (if needed) and build back into a string again.

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • Andrew Beckett
    Andrew Beckett over 1 year ago

    If you just want to filter the values (that might be what you mean by "sorted", it wasn't clear):

    list_b = buildString(pcreMatchList("^s" parseString(list_a ", ")) ", ")

    if you want them sorted too:

    list_b = buildString(sort(pcreMatchList("^s" parseString(list_a ", ")) 'alphalessp) ", ")

    The trick is to parse the string into a list, filter with a regular expression, sort (if needed) and build back into a string again.

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
No Data

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information