안드로이드 개발 질문/답변
(글 수 45,052)
String name1 = "홍길동";
String message = String.format(getContext().getString(R.string.signupcomplete_description), name1);
text3.setText(message);
이런식으로 해결 했습니다. 그러면 추가로
<string name="as"><xliff:g id="name1">%s</xliff:g>고객<xliff:g id="name2">%s</xliff:g></string>
와 같이 한 string내에서 두개의 동적인 스트링값을 넣고 싶을때는 어떻게 하나요?




static String format(String format, Object... args) 입니다.
즉 format에 해당하는 데이터 만큼 뒤에 파라메터를 추가하면 됩니다.
이 경운 String message = String.format(getContext().getString(R.string.signupcomplete_description), name1, name2);이겠죠..