If i get the input like this ina variable
,2019
Output should be 2019
Input2
2022,2023,2019
Output should be
2022,2023,2019
Input 3
2022,2023,2019,
Output should be
2022,2023,2019
Need to remove empty commas
If i get the input like this ina variable
,2019
Output should be 2019
Input2
2022,2023,2019
Output should be
2022,2023,2019
Input 3
2022,2023,2019,
Output should be
2022,2023,2019
Need to remove empty commas
Hi @sruthesanju
You can use the following:
strValue.trim(","c)
Here, strValue is the string variable in which the value is stored.
Edit: Verify the TRIM function
Hope this helps,
Best Regards.
If my input is ,2019,2019
Output should be 2019,2019
But i am getting result as 2019,2019
Hey @sruthesanju
Output should be 2019,2019
But i am getting result as 2019,2019
What is the difference in this can you specify its the same right ?
Do you mean you want to remove the comma in between also ?
Yes between as commas need to remove
Getting error in opening the code can you share the pic of the code
Please try this
System.Text.RegularExpressions.Regex.Replace(str.Trim(","c),",{2,}",",")
cheers
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.