开发者

Manipulating String Perl SVs in C

开发者 https://www.devze.com 2023-03-25 00:10 出处:网络
I\'m currently 开发者_开发知识库trying to do some string based manipulation in an attempt to speed up a section of traditional Perl code. The original Perl code looks like

I'm currently 开发者_开发知识库trying to do some string based manipulation in an attempt to speed up a section of traditional Perl code. The original Perl code looks like

my $value = 'abCdE';
my $uc_value = uc($value);

I've looked at the Perl guts API and it seems that I can accomplish this using toUPPER() but this works on a single char at a time. I seem to be missing how you can loop through the backing char array, uppercasing each letter & then assigning it into a new SV.

Any help is much appreciated.


Perl does not provide a lot of its functionality to C level extensions, uppercasing is apparently one of those features. At best, you can look at how the core implements this, but it's really not all that pretty.

0

精彩评论

暂无评论...
验证码 换一张
取 消