benefits of using encapsulation characters?
Posted: Thu Nov 17, 2005 2:09 pm
Someone tried to persuade me into using encapsulation characters in addition to delimiting each variable in an string that is going to be parsed. I've never used encapsulation characters before, and would like to know why this would be benefitial. As far as I can tell, it would just cause more work. The idea I suppose, is to make it less likely that you would separate the variables incorrectly. To me, adding a single character encapsulation to a single character delimited string of variables, is the same as have a three character delimiter.
|variable1|,|variable2|,|variable3| // delimiter is the "comma" and the encaps char is "pipe"
what's the difference in next example?
variable1|,|variable2|,|variable3 / delimiter is "pipe comma pipe"
In both instances, you have to separate them using the same three characters. And there's the same possibilty that that combination of characters resides in any of the variables. So, using encapsulation characters doesn't seem to be any safer. The only difference is that now you have to remove the encapsulation characters on the ends.
Just wondering if someone knows why using encapsulation characters would be benefitial. I can't get a solid explanation from this someone or anywhere on the net.
Thanks in advance for any information about this topic.
|variable1|,|variable2|,|variable3| // delimiter is the "comma" and the encaps char is "pipe"
what's the difference in next example?
variable1|,|variable2|,|variable3 / delimiter is "pipe comma pipe"
In both instances, you have to separate them using the same three characters. And there's the same possibilty that that combination of characters resides in any of the variables. So, using encapsulation characters doesn't seem to be any safer. The only difference is that now you have to remove the encapsulation characters on the ends.
Just wondering if someone knows why using encapsulation characters would be benefitial. I can't get a solid explanation from this someone or anywhere on the net.
Thanks in advance for any information about this topic.