G Georgi Member Jun 20, 2020 #1 Hi, i have string array which changes its length after regex.split. Code: Copy Sub globals dim components(12) as string dim string_map as string end sub sub get_data string_map = "1,2,3" components = Regex.Split(",",string_map) ..... end sub For example, if string_map is "1,2,3", components.length is no more 12, but 3 ? Last edited: Jun 21, 2020
Hi, i have string array which changes its length after regex.split. Code: Copy Sub globals dim components(12) as string dim string_map as string end sub sub get_data string_map = "1,2,3" components = Regex.Split(",",string_map) ..... end sub For example, if string_map is "1,2,3", components.length is no more 12, but 3 ?
Erel B4X founder Staff member Licensed User Longtime User Jun 21, 2020 #2 Please use [code]code here...[/code] tags when posting code. You don't need to set the length when you declare the array. Regex.Split returns a new array anyway. Code: Copy Sub globals dim components() as string dim string_map as string end sub sub get_data string_map = "1,2,3" components = Regex.Split(",",string_map) ..... end sub Upvote 0
Please use [code]code here...[/code] tags when posting code. You don't need to set the length when you declare the array. Regex.Split returns a new array anyway. Code: Copy Sub globals dim components() as string dim string_map as string end sub sub get_data string_map = "1,2,3" components = Regex.Split(",",string_map) ..... end sub