*字符截取操作
String1 := 'abcdefghij'
String2 := '0123456'
Message := '字符截取操作'
Message[1] := 'String1 := \'abcdefghij\''
Message[2] := 'String2 := \'0123456\''
dev_clear_window()
dev_disp_text(Message, 'window', 0, 0, 'white', 'box_color', '#00ffff4c')
tuple_substr (String1, 3, 5, SingleSubstring1)
dev_disp_text('tuple_substr (String1, 3, 5, SingleSubstring1)执行结果为'+SingleSubstring1, 'window', 50, 0, 'white', 'box_color', '#00ffff4c')
SingleSubstring2 := String1{3:5}
dev_disp_text('SingleSubstring2 := String1{3:5}执行结果为'+SingleSubstring2, 'window', 70, 0, 'white', 'box_color', '#00ffff4c')
tuple_substr (String1, [1,2,3], [3,6,3], MultipleIndices1)
SingleSubstring2 := String1{3:5}
dev_disp_text('tuple_substr (String1, [1,2,3], [3,6,3], MultipleIndices1)执行结果为'+MultipleIndices1, 'window', 90, 0, 'white', 'box_color', '#00ffff4c')
MultipleIndices2 := String1{[1,2,3]:[3,6,3]}
dev_disp_text('MultipleIndices2 := String1{[1,2,3]:[3,6,3]}执行结果为'+MultipleIndices2, 'window', 150, 0, 'white', 'box_color', '#00ffff4c')
tuple_substr ([String1,String2], 3, 5, MultipleInputStrings1)
dev_disp_text('tuple_substr ([String1,String2], 3, 5, MultipleInputStrings1)执行结果为'+MultipleInputStrings1, 'window', 210, 0, 'white', 'box_color', '#00ffff4c')
MultipleInputStrings2 := [String1,String2]{3:5}
dev_disp_text('MultipleInputStrings2 := [String1,String2]{3:5}执行结果为'+MultipleInputStrings2, 'window', 250, 0, 'white', 'box_color', '#00ffff4c')
tuple_substr ([String1,String2], [5,0], [8,1], MultipleInputStringsAndIndices1)
dev_disp_text('tuple_substr ([String1,String2], [5,0], [8,1], MultipleInputStringsAndIndices1)执行结果为'+MultipleInputStringsAndIndices1, 'window', 310, 0, 'white', 'box_color', '#00ffff4c')
MultipleInputStringsAndIndices2 := [String1,String2]{[5,0]:[8,1]}
dev_disp_text('MultipleInputStringsAndIndices2 := [String1,String2]{[5,0]:[8,1]}执行结果为'+MultipleInputStringsAndIndices2, 'window', 350, 0, 'white', 'box_color', '#00ffff4c')
tuple_substr ([String1,String2], 1, 0, EmptySubstring1)
dev_disp_text('tuple_substr ([String1,String2], 1, 0, EmptySubstring1)执行结果为'+EmptySubstring1, 'window', 390, 0, 'white', 'box_color', '#00ffff4c')
EmptySubstring2 := [String1,String2]{1:0}
dev_disp_text('EmptySubstring2 := [String1,String2]{1:0}执行结果为'+EmptySubstring2, 'window', 430, 0, 'white', 'box_color', '#00ffff4c')
标签:disp,字符,color,截取,dev,window,基本操作,String2,String1 From: https://www.cnblogs.com/echo-efun/p/18053828