How to trim spaces for parameter value in jenkins pipeline? I am using jenkins pipeline job with parameters. when i had any trailing spaces in parameter value the job gets failed. is there any way to trim the spaces in pipeline job to avoid build failure?
Use the Groovy trim() method.  For instance, def myTrimmedParam = params.myParam.trim().