-3

I searched many posts I got meaning of (String... args) but now my problem is how can I get count of these parameters inside a function. Any help is appreciated...

Ghanshyam Bagul
  • 169
  • 1
  • 12
  • 1
    Possible duplicate of [What is the ellipsis (...) for in this method signature?](https://stackoverflow.com/questions/2367398/what-is-the-ellipsis-for-in-this-method-signature) – GhostCat Jul 25 '17 at 18:39
  • 1
    Please consider trying that "prior research" thing the next time. – GhostCat Jul 25 '17 at 18:40
  • You should try it on your own and then post your question. This doesn't show any effort. – Farini Jul 25 '17 at 18:41

1 Answers1

3

You can use length method. Basically its a Array so you can treat it as Array.

  public void doInBackground(String… args) {

    int count = args.length;

}

For getting value from index - you could use

String value = args[index];
Rahul
  • 10,457
  • 4
  • 35
  • 55