soulslicer
Tank
- Joined
- Mar 16, 2007
- Messages
- 4,623
- Reaction score
- 12
Okay, I'm been trying to get this concept to work but failing.
Very Simply: My Objective:
I have a function that can receive not just strings, but a whole ARRAY intself. Say receive an array that has 5 strings..
and I want to change each of those strings say .ToLower(), .Trim() etc.
and send that back to the Main Function as a fully changed Array.
and this can easily be repeated on other string arrays
So I tried this :
unfortunately, the error message is that i cannot implicitly convert an arraystring to a string in the second line of Main(). and also that I cannot return stringer[]
is there anyway you guys can help me resolve this, or write something for me
Very Simply: My Objective:
I have a function that can receive not just strings, but a whole ARRAY intself. Say receive an array that has 5 strings..
and I want to change each of those strings say .ToLower(), .Trim() etc.
and send that back to the Main Function as a fully changed Array.
and this can easily be repeated on other string arrays
So I tried this :
Code:
static string StringEditor(string[] stringer)
{
for(int i=0;i<stringer.Length;i++)
{
stringer[i].ToLower();
stringer[i].Trim();
}
return stringer[];
}
static void Main(string[] args)
{
string[] power = { "He llo", "Boy", "GAGAGA" };
string[] newe = StringEditor(power);
foreach (string yy in newe)
{
Console.WriteLine(yy);
}
Console.ReadLine();
}
unfortunately, the error message is that i cannot implicitly convert an arraystring to a string in the second line of Main(). and also that I cannot return stringer[]
is there anyway you guys can help me resolve this, or write something for me