0

I have a statement like

bicCode.ToUpper().TrimEnd('X');

I want to rewrite this in javascript

response.data.toUpperCase().??

How to write trimend function in javascript?

7
  • 1
    @Equalsk that's not really the same behaviour as TrimEnd. Commented Feb 2, 2017 at 14:50
  • Why don't you try the following: codereview.stackexchange.com/questions/28464/… Commented Feb 2, 2017 at 14:50
  • 1
    @DavidSherret You're right I worded it badly but it wasn't meant to directly answer the question, it was more a problem that OP showed no effort. I'm not even a JavaScript guy but after reading that thread I wrote TrimEnd in about 2 minutes: jsfiddle.net/cgvw5x9e and if I can do it then OP can. Commented Feb 2, 2017 at 15:28
  • 1
    @Jakotheshadows Can't answer locked posts. Commented Jun 14, 2017 at 19:51
  • 1
    yeah, god forbid people be able to easily find useful information on a site designed to help people do just that. Better to make a superficial examination of the post, incorrectly conclude that its a duplicate, and close it thus wasting the productivity of the people (including yourself) who contributed to comments and answers and robbing the OP of a good question. Commented Jun 22, 2017 at 13:59

1 Answer 1

3

This should work:

response.data.toUpperCase().replace(/\s+$/g, '');

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.