H
Howard
Can anyone think of a better algorithm for this function? Since longStr
could be very large in size (~100k).
The function will return a string array with words that are larger than
n in length. Where n is a positive integer.
string longStr = "asdfd DSFSDFSDFDSFASGDFD";
void FindLongWord(int length)
{
string [] array;
array = longStr.split(' ');
for(int i =0;i < array.Length; i++)
{
if (array.Length >= length)
{
//add to arraylist...
}
}
}
Thanks,
Howard
could be very large in size (~100k).
The function will return a string array with words that are larger than
n in length. Where n is a positive integer.
string longStr = "asdfd DSFSDFSDFDSFASGDFD";
void FindLongWord(int length)
{
string [] array;
array = longStr.split(' ');
for(int i =0;i < array.Length; i++)
{
if (array.Length >= length)
{
//add to arraylist...
}
}
}
Thanks,
Howard