18 January 2026:
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
This forum is now archived and is in read-only mode. Please continue discussions on our improved new Sahi Pro Community forum.
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
Problem with Substring
Hi,
I am using the following code to read through a string variable but it always returns a null value,
please help
var $temp_value = "Friend";
for (var $i = 0; $i < $temp_value.length; $i++){
if ($temp_value.substring(i, i+1) == "F"){
$c ++;
}
}
Thanks,
I am using the following code to read through a string variable but it always returns a null value,
please help
var $temp_value = "Friend";
for (var $i = 0; $i < $temp_value.length; $i++){
if ($temp_value.substring(i, i+1) == "F"){
$c ++;
}
}
Thanks,
Comments
i think you forgot the dollars on the i_variable:
var $temp_value = "Friend";
for (var $i = 0; $i < $temp_value.length; $i++){
if ($temp_value.substring($i, $i+1) == "F"){
$c ++;
}
}
this should work.
regards
Wormi
Thanks that works, my mistake for missing that out, any idea on the other topic i posted?
Thanks,