0

I am writing a shell script(csh) to split below STRING into two parts STRING1 & STRING2.

STRING = firstname_middlename_lastname

STRING1 = firstname

STRING2 = middlename_lastname

and display STRING2.

firstname, middlename, lastname can be of any characters, hence I thought of splitting the STRING once first underscore encounter. Can someone help here how to do this in csh. Thanks in advance.

Best Regards.

Tapas
  • 1
  • 1
  • Does this answer your question? [How do I split a String in CSH?](https://stackoverflow.com/questions/7735160/how-do-i-split-a-string-in-csh) – fork2execve Apr 16 '22 at 14:46
  • This solution split all the element with an "_" to make an array. I wanted to split the string into two sub strings. – Tapas Apr 18 '22 at 09:25
  • in that case drop the letter ‘a’ from the modifier. – fork2execve May 07 '22 at 03:24

0 Answers0