문제

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