Take the 2-minute tour ×
English Language & Usage Stack Exchange is a question and answer site for linguists, etymologists, and serious English language enthusiasts. It's 100% free, no registration required.

Maybe I'm just not very good with Google, but I'm looking for good terms to use when describing manipulation of strings of characters, specifically words to describe:

  • Removing a prefix
  • Removing a suffix
  • Removing an infix, i.e. taking out some middle part and concatenating the remaining parts

    A more or less comprehensive list of string manipulation terminology would be nice, but just providing the above definitions would suffice.

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

If you look at various string-manipulation libraries, tools, and programming languages, you will see a variety of different verbs used here, most of which are general and not location specific.

  • remove — anywhere
  • delete — anywhere
  • strip — usually anywhere
  • trim — usually on the two ends only: front/rear or left/right
  • splice — either medial only, or anywhere
  • chop, chomp — the rear end

Since there is little consensus here, you should probably just be explicit in your language:

s/^string//;      # delete_from_front(), remove_leading()
s/string$//;      # delete_from_end(), remove_trailing()
s/string//g;      # delete_all(), remove_all()
share|improve this answer
    
I think I've also seen lop for cutting off an end but don't have a reference –  jwpat7 Nov 30 '12 at 17:09
    
I think there's usually a difference between "strip off" and "strip out" (of course, "off" or "out" may be implied in a method/function name, which may lead to confusion). –  Neil Coffey Nov 30 '12 at 17:33
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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