#!/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; }
In reply to C to Java string conversion script by perlmoth
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |