【发布时间】:2017-09-26 21:09:28
【问题描述】:
我有一个通过 SMS 发送消息的模块。如果消息是静态的,我可以将变量放在字符串中,但是用户请求消息可以随意更改。
我创建了这个变量
- 公司名称
- 客户姓名
- 账单号码
- 付款
例子:
来自{公司}。 {CustomerName} 先生/女士,您好,您的帐单号码是 {BillNumber},总付款为 {Payment}。我们想通知您 物品已完成并可以收集。
我当前的代码适用于静态消息,
string messageSms = "From " +Company+ ". Hi Mr/Mrs "+{CustomerName}+", your bill number is "+{BillNumber}+" with a total payment of "+{Payment}+". We want to inform you the items has been completed and ready for collection.";
但是如何处理动态消息呢?如何检测字符串中的变量并在变量上设置数据?
我也关注这个article,但帮助不大。
【问题讨论】:
-
你能举一个期望输入/输出的例子吗?
-
您能否详细说明您要处理的案件?