[英]Adding a String from a List inside another String
I have a List<Object>
that is being sent, and inside each of its objects, there's a string parameter userFullName
. 我有一个要发送的
List<Object>
,并且在每个对象中都有一个字符串参数userFullName
。
Then I have this (I'll use %%
to enclose that which I do not know how to code right): 然后我有这个(我将使用
%%
封装不知道如何正确编码的内容):
var userDetails = AJS.$("<h1/>").text("Hello %userFullName%! Welcome!");
This is my list: 这是我的清单:
args.weekData.list
How do I grab the parameter inside the object on the List (like in Java: list[0].userFullName
) and add it to the userDetails
String? 如何在List上的对象内部获取参数(如Java:
list[0].userFullName
)并将其添加到userDetails
字符串中?
Like so: 像这样:
var userDetails = AJS.$("<h1/>").text("Hello " + args.weekData.list[0].userFullName + "! Welcome!");
Use +
for string concatenation with JS 使用
+
与JS进行字符串连接
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.