Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

ring convert string lines to list items and convert the list to a string

str2list(string) ---> list contains the string lines
list2str(list)   ---> string contains the list items
Comment

ring convert string lines to list items and convert the list to a string

/* output:
** Items : 4
** Item : Hello
** Item : How are you ?
** Item : are you fine ?
** Item : ok
** list2Str result = Hello
** How are you ?
** are you fine ?
** ok
** Done
*/

mystr = "Hello
How are you ?
are you fine ?
ok"

mylist = str2list(mystr)
see "Items : " + len(mylist) + nl

for x in mylist
        see "Item : " + x + nl
next

newstr = list2str(mylist)
see "list2Str result = " + newstr

if mystr = newstr
        see nl + "Done"
else
        see nl + "Error!"
ok
Comment

PREVIOUS NEXT
Code Example
Python :: ring get the type a given path (file or directory) 
Python :: ring load the odbclib.ring library 
Python :: ring define private attributes and methods 
Python :: plt datas use left and right yaxes 
Python :: qtextedit insert unicode 
Python :: candelstick chart matplotlib 
Python :: ring execute the program line by line 
Python :: how to split from a specific charecter tfrm the end of string 
Python :: plot a list of number in python 
Python :: importing cosine from scipy 
Python :: get next element while looping 
Python :: set change order python 
Python :: python list of datetimes as type string 
Python :: how to auto create a three dimensional array in python 
Python :: django save another class data while saving a class 
Python :: gun in python turtle 
Python :: python class overwrite length method 
Python :: how to perform a two-way anova with python 
Python :: python generator in while loop 
Python :: count items in a model django rest 
Python :: how to add trailing zeros in the number 
Python :: what does alpha in plt.txt do 
Python :: tuples in python 
Python :: discord py replace characters from string 
Python :: pyteal atomic transfer 
Python :: Access value 
Python :: How to run python in command promt 
Python :: How to Use Sets to Remove Duplicate Items in Other Data Structures 
Python :: how to remove hidden white spaces n columns 
Python :: short hand function pytho 
ADD CONTENT
Topic
Content
Source link
Name
6+6 =