1

I need to extract the first 3 characters of jenkinsfile parameter:

string(name: 'DB_Type', defaultValue: 'mysql'  )

I tried the following but this did not work:

prefix=${params.db_type}
prefix=prefix.substring(0,2)

user312307
  • 153
  • 6
  • 21

1 Answers1

2
params.DB_Type?.substring(0,3)
cfrick
  • 35,203
  • 6
  • 56
  • 68