Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8395759
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T20:22:56+00:00 2026-06-09T20:22:56+00:00

is it possible to have a public method that returns multiple values and then

  • 0

is it possible to have a public method that returns multiple values and then later call that method only retrieving the value that you want?

public static string Values()
{
    string length = DAL.Util.getlength();
    string Name = DAL.Util.getName(ddlID.SelectedValue);
    return length + Name;
}

now I know if I were to call this method just by saying

string a = Values();

it would return the concatenated string of both length and Name, but is there anyway to call just a specific variable from that method even if it were 10 variables long?

Thanks for any advice and help you can provide.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T20:22:57+00:00Added an answer on June 9, 2026 at 8:22 pm

    Sounds like what you actually want is a struct (or a class)

    public struct MyStruct
    {
        public string length
        public string name
    }
    
    public static MyStruct Values()
    {
        MyStruct result;
        result.name = DAL.Util.getName(ddlID.SelectedValue);
        result.length = DAL.Util.getlength();
        return (result);
    }
    

    Then you can look at the different elements of the struct as you like.

    MyStruct data = Values();
    Console.WriteLine(data.name);
    Console.WriteLine(data.length);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm wondering if it's possible to recover a RSA public key that I have
Possible Duplicate: How to mock a method that returns an int with MOQ Here's
In an asp.net mvc application I have a method that returns a JsonResult to
In an ASP.NET MVC3 application I have an Action method that returns a file
Is it possible to have a ActionResult with a signature of: [HttpPost] public ActionResult
Possible Duplicate: Comparing object properties in c# Let's say I have a POCO: public
Is it possible to use a public repository like github and have a branch
Is it possible to have a free iPhone app that has say an initial
Is it possible to have multiple backend user group access lists in Typo3? For
I have some data that is both read and updated by multiple threads. Both

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.