0

In programming, the word “concatenation” is often used for combining multiple individual strings into one. Is there a reverse of this? For dropping a piece of a string, or number?

For example, in some weather contexts, you’ll still see numbers like 1012.5, but it becomes 125. What is a word that means this “trim” of numbers/characters?

7
  • 2
    I can't see how 1012.5 becomes 125. Could we have more examples, please?
    – Andrew Leach
    Commented Oct 13, 2018 at 16:13
  • @Andrew Leach in that case it’s just dropping the 10 and removing the decimal, but that’s a bad example I suppose. Really just looking for a word that’s the reverse of concatenation. Could have sworn there was something other than “trim” or “split”
    – laken
    Commented Oct 13, 2018 at 16:16
  • 1
    There is, but please provide better examples so I can be sure that the word I'm thinking of is actually the one for your situation.
    – Andrew Leach
    Commented Oct 13, 2018 at 16:17
  • Try truncation (verb: truncate). Though it has a specific meaning in decimal numbers, if you mean something more general (the opposite of "trim") then it works for you.
    – Robusto
    Commented Oct 13, 2018 at 16:21
  • 1
    Per Merriam-Webster, antonyms of concatenate include disconnect, disjoin, disjoint, dissever, disunite, separate, unchain, uncouple, unhitch, unlink, and unyoke. (Or, most colloquially, split, as in one of the provided answers.) But, aside from asking for the opposite of concatenate, nothing you've described actually means the opposite of concatenation. Commented Oct 13, 2018 at 18:09

2 Answers 2

1

It's possible that you're thinking of truncate (dictionary.com) but that generally refers to removing one end of something. It usually wouldn't apply to any shortening that takes place in the middle.

1

In my opinion to split a string is the opposite. In modern programming languages you can find a split method to do this job.

For further information you could check the split method description of the programming langue Java: Java documentation

2
  • split typically returns both parts. truncate only returns one part.
    – Jim
    Commented Oct 13, 2018 at 20:11
  • Hi Mikail. The system has flagged your answer for closure as "low-quality because of its length and content." An answer on this site is expected to be authoritative, detailed, and explain why it is correct, whereas you're offering a personal opinion without anything to support it. You can edit your answer to avoid closure - e.g. add a reference for "split" used in this context, linked to the source. For further guidance, see How to Answer. :-) Commented Oct 13, 2018 at 23:06

Not the answer you're looking for? Browse other questions tagged or ask your own question.