O2-DQ User Interface 1.0.0
Loading...
Searching...
No Matches
stringOperations Namespace Reference

Functions

def listToString (list s)
 
def stringToList (str string)
 

Function Documentation

◆ listToString()

def listToString ( list  s)
ListToString provides converts lists to strings with commas.
This function is written to save as string type instead of list


Args:
    s (list): Input as List

Returns:
    string: Comma seperated string

Definition at line 19 of file stringOperations.py.

19def listToString(s: list):
20 """
21 ListToString provides converts lists to strings with commas.
22 This function is written to save as string type instead of list
23
24
25 Args:
26 s (list): Input as List
27
28 Returns:
29 string: Comma seperated string
30 """
31 if len(s) > 1:
32 # initialize an empty string
33 str1 = ","
34
35 # return string
36 return str1.join(s)
37 else:
38 str1 = " "
39
40 return str1.join(s)
41
42

◆ stringToList()

def stringToList ( str  string)
stringToList provides converts strings to list with commas.
This function is written to save as list type instead of string

Args:
    string (string): Input as String

Returns:
    list: merge string elements with comma 

Definition at line 43 of file stringOperations.py.

43def stringToList(string: str):
44 """
45 stringToList provides converts strings to list with commas.
46 This function is written to save as list type instead of string
47
48 Args:
49 string (string): Input as String
50
51 Returns:
52 list: merge string elements with comma
53 """
54 li = list(string.split(","))
55 return li