Hi Team,
I have to write below string in string format method.
Input: Per TMCCC: Waived $‘{0}’ on-site assessment. Not covered by QSP: Quoted $‘{1}’/‘{2}‘min, additional time $’{3}’/'{4}'min; #160.
Output : Per TMCCC: Waived $39 on-site assessment. Not covered by QSP: Quoted $30/20min, additional time $22/32min; #160
Thanks,
Manoj.
rlgandu
(Rajyalakshmi Gandu)
2
@manojmanu.rpa
String.Format("Per TMCCC: Waived ${0} on-site assessment. Not covered by QSP: Quoted ${1}/{2}min, additional time ${3}/{4}min; #160", 39, 30, 20, 22, 32)
1 Like
vrdabberu
(Varunraj Dabberu)
3
Hi @manojmanu.rpa
Save the values you want to replace in seperate variables like below
value1 = "39"
value2 = "30"
value3 = "20"
value4 = "22"
value5 = "32"
After that use the below syntax in Assign activity:
formattedString = String.Format("Per TMCCC: Waived ${0} on-site assessment. Not covered by QSP: Quoted ${1}/{2}min, additional time ${3}/{4}min; #160", value1, value2, value3, value4, value5)
Regards
Can we remove ’ symbol by using String format method?
vrdabberu
(Varunraj Dabberu)
5
Hi @manojmanu.rpa
Input = "Per TMCCC: Waived $‘{0}’ on-site assessment. Not covered by QSP: Quoted $‘{1}’/‘{2}‘min, additional time $’{3}’/'{4}'min; #160."
Input = Input.Replace("‘","").Replace("’","").Replace("'","")
value1 = "39"
value2 = "30"
value3 = "20"
value4 = "22"
value5 = "32"
formattedString = String.Format(Input, value1, value2, value3, value4, value5)
Regards
vrdabberu
(Varunraj Dabberu)
6
Check the below flow for better understanding @manojmanu.rpa
Input = "Per TMCCC: Waived $‘{0}’ on-site assessment. Not covered by QSP: Quoted $‘{1}’/‘{2}‘min, additional time $’{3}’/'{4}'min; #160."
Input = Input.Replace("‘","").Replace("’","").Replace("'","")
value1 = "39"
value2 = "30"
value3 = "20"
value4 = "22"
value5 = "32"
formattedString = String.Format(Input, value1, value2, value3, value4, value5)
FLOW:
Regards
system
(system)
Closed
7
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.