Js Array Get Subarray Javascript Substring Function In Cpp