LMU
LMU

Reputation: 1

Using value returned by a method as input parameter in C#

I have a method returnNo in C# that returns a string as shown below.

public string RecordNo()
{
    //Get the string of the Record No from the page
    string recordSavedNumber = recordNoForRecord.Text.Replace("- Record #", "");
    return recordSavedNumber;
}

I also want to use the recordSavedNumber returned by the method above as input parameter in a searchMethod show below

public void searchRecord(string recordNum){
// do something
}

Can someone please assist how I can do that?

Upvotes: 0

Views: 191

Answers (1)

pm100
pm100

Reputation: 50230

Like this

 var num = RecordNo();
 searchRecord(num);

or like this:

searchRecord(RecordNo());

Upvotes: 2

Related Questions