C# - Using a methods string in another method
I currently have a method that removes duplicates from a line, although the output is currently going into a new file. How could I instead use the output as a string and then use it in another 开发者_开发百科method:
Well, you can store the return value of the first method in a variable and pass it to the second method (after modifying the second to accept an argument):
var str = RemoveDuplicate(someValue, someOtherValue);
CompareFiles(str);
The second method would need to be defined with an argument:
private static void CompareFiles(string someValue)
{
// implementation
}
精彩评论