kcl-lang / kcl-lang.io

KCL Website and Documentation Repo: https://kcl-lang.io
https://kcl-lang.github.io
Apache License 2.0
13 stars 34 forks source link

[FAQ] How to join list into string #357

Closed borgius closed 4 months ago

borgius commented 5 months ago

Feature Request

Very common user case: When we want to join our list into a string with some separator (like a comma ",").

L = ['a', 'b', 'c']
S = L.join(',')
Peefy commented 5 months ago

Hello, you can do

S = ",".join(['a', 'b', 'c'])
borgius commented 5 months ago

Great! Thank you!

How to get list of all functions for string and list?

Peefy commented 5 months ago

Hello @borgius You can see the string spec https://www.kcl-lang.io/docs/reference/lang/spec/datatypes#string to find more information.

d4v1d03 commented 4 months ago

Hey @Peefy , made a Pr #373

Peefy commented 4 months ago

Closed by #373