-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStringUtils.py
More file actions
37 lines (29 loc) · 773 Bytes
/
Copy pathStringUtils.py
File metadata and controls
37 lines (29 loc) · 773 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
'''
Created on Oct 12, 2016
@author: salim
'''
class MyClass(object):
'''
classdocs
'''
def __init__(self, params):
'''
Constructor
'''
def joinTest(self):
s="-"
collection = ['hey', "hello", 'd']
res = s.join(collection)
return res
def splitStr(self, strparam, delimiter):
arr = strparam.split(delimiter)
print arr
return arr
myClass = MyClass("params")
print(myClass.joinTest())
str_param = "[50FIT STL GV 530S 90D] SINGLE TH.NIPPLE 1/2 X 90CM STL"
if "[" in str_param and "]" in str_param:
arr = myClass.splitStr(str_param,"]")
print "res->"+arr[0] + "/"+arr[1]
res = myClass.splitStr(arr[0],"[")
print "res->"+res[1]