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?

有帮助吗?

解决方案

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);
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top