Pergunta

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?

Foi útil?

Solução

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);
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top