i trying return data foreach "hostedid" can help?
public static string gethostedrecordset() { var request = new listhostedzonesrequest() { maxitems = "1" }; var list = client.listhostedzones(request); foreach (var hostedid in list.hostedzones) { console.writeline("\n hosted id is:"); console.write(hostedid.id); } return hostedid; }
if want return values single string can concatenate them delimiter, such ','
:
public static string gethostedrecordset() { var request = new listhostedzonesrequest() { maxitems = "1" }; var list = client.listhostedzones(request); stringbuilder result = new stringbuilder(); foreach (var hostedid in list.hostedzones) { result.append(hostedid.id).append(","); } return result.tostring(0, math.max(0, result.length - 1); }
Comments
Post a Comment