perlmoth has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -w use strict; use diagnostics; sub jc { my ($c_str) = shift; my $j_str = ""; foreach (split //, $c_str) { $j_str = $j_str . "(byte)\'$_\',"; } return $j_str; } while (<>) { s/\"(.+)\"/"{".&jc($1)."}"/e; print; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: C to Java string conversion script
by VSarkiss (Monsignor) on Dec 01, 2001 at 21:55 UTC | |
Re: C to Java string conversion script
by Fastolfe (Vicar) on Dec 01, 2001 at 22:07 UTC | |
by perlmoth (Hermit) on Dec 01, 2001 at 23:45 UTC | |
Re: C to Java string conversion script
by impossiblerobot (Deacon) on Dec 01, 2001 at 21:44 UTC | |
Re: C to Java string conversion script
by chipmunk (Parson) on Dec 02, 2001 at 02:22 UTC | |
Re: C to Java string conversion script
by converter (Priest) on Dec 02, 2001 at 08:12 UTC | |
Re: C to Java string conversion script
by atcroft (Abbot) on Dec 02, 2001 at 10:22 UTC |