title: unable to remove trailing space in spark scala dataframe
body: <p>I have a <code>DataFrame</code> and i have applied different functions to replace trailing space but there is no luck</p>
  
  <pre><code>df.select(col("e_no"),regexp_replace(col("e_no"),"//s+$",""),rtrim(col("e_no")),length(col("e_no"))).show()
  
  e_no   | regexp_replace(e_no),//s+$, )| rtrim(e_no)|  length(e_no)
  525071 |          525071 |              525071 |      7
  512938|           512938|               512938|       6
  522783 |          522783 |              522783 |      7
  </code></pre>
  
  <p>please could you advise.</p>