Finding Number

Hi Team,

I need to find a specific number say 7 and find the length (including 7)

For the above example find the position where 7 and from there we need to find its length. For the above example length from 7 for all three examples is 10. Need sample coding.


Hi @Robotics

you can assign your number to a string variable(num_var) and find the index of 7 by num_var.IndexOf(“7”) ,assign it to int variable let sat index_seven it will give you first index of 7 after that just find required length by (num_var.length-index_seven).

1 Like

Thanks amit, working fine.