Question

I'm gonna build an application when elements are chosen from menu and their corresponding query string's parameters must change in order to display information:

Query string example: "?inst=8&group=4420&semestr=1&semest_part=2". Can you tell how to do this?

Was it helpful?

Solution

use String.format

int inst = 8;
int group = 4420;
int semestr = 1;
int semestr_part = 2;
String query = String.format("?inst=%d&group=%d&semestr=%d&semest_part=%d", inst, group, semestr, semestr_part);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top