0

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?

1 Answer 1

2

Like this

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

or like this:

searchRecord(RecordNo());
Sign up to request clarification or add additional context in comments.

2 Comments

@Joel Coehoorn i suspect there is more to it that this simple answer tho, seems too easy
Thanks. The first one is the one that worked

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.