oleanganesh
MIS
Hi,
I have a string which has some "Enter keys" (\n). I am looping through the string for each occurance of the "\n".
I need to get the substring before the occurance of "\n".
For eg:
string = "This is a test string. (enter key) Each string has some values (enter key) and some defined attributes (enter key)."
I need to get the length of the substring before the enter key and between the enter keys.
I have code like this below. I need to find the length of the substring between the enter keys and check for some validation. Any ideas? Thanks
if (window.event.keyCode == 13)
{
while (i < strField.length)
{
if (strField.charAt(i) == "\n")
{
Lines = Lines + 1;
}
i = i + 1;
}
if (Lines > 5)
{
//alert("tesT");
}
}
I have a string which has some "Enter keys" (\n). I am looping through the string for each occurance of the "\n".
I need to get the substring before the occurance of "\n".
For eg:
string = "This is a test string. (enter key) Each string has some values (enter key) and some defined attributes (enter key)."
I need to get the length of the substring before the enter key and between the enter keys.
I have code like this below. I need to find the length of the substring between the enter keys and check for some validation. Any ideas? Thanks
if (window.event.keyCode == 13)
{
while (i < strField.length)
{
if (strField.charAt(i) == "\n")
{
Lines = Lines + 1;
}
i = i + 1;
}
if (Lines > 5)
{
//alert("tesT");
}
}