I have a problem generating a string for an "index".
As an example, if I get the number 1.2, I wanted to generate the number 1.2.4 as a string or if I get 1.2.2 I wanted to generate 1.2.2.1
<select>
<option>1.1 </option>
<option>1.1.1 </option>
<option>1.1.2 </option>
<option>1.2 </option>
<option>1.2.1 </option>
<option>1.2.2 </option>
<option>1.2.3 </option>
<option>1.2.3.1 </option>
<option>1.3 </option>
<option>1.3.1 </option>
</select>
In case I would have to check how many elements this "index" would have and generate a new one, but I'm having a problem with its logic.
If anyone can help. Thanks in advance.