क्या आप बस इसका इस्तेमाल करना चाहते हैं, या आप किसी कारण से कोड पर जोर देते हैं?
मेरे डेबियन सिस्टम पर, ऐसा लगता है कि strings
कमांड बॉक्स से बाहर कर सकता है। मैनपेज से बहिष्कार देखें:
--encoding=encoding
Select the character encoding of the strings that are to be found. Possible values for encoding are: s = single-7-bit-byte characters (ASCII, ISO 8859,
etc., default), S = single-8-bit-byte characters, b = 16-bit bigendian, l = 16-bit littleendian, B = 32-bit bigendian, L = 32-bit littleendian. Useful
for finding wide character strings.
संपादित करें: ठीक है। मुझे सी # नहीं पता है, इसलिए यह थोड़ा बालों वाला हो सकता है, लेकिन मूल रूप से, आपको वैकल्पिक शून्य और अंग्रेजी वर्णों के अनुक्रमों की खोज करने की आवश्यकता है।
byte b;
int i=0;
while(!endOfInput()) {
b=getNextByte();
LoopBegin:
if(!isEnglish(b)) {
if(i>0) // report successful match of length i
i=0;
continue;
}
if(endOfInput()) break;
if((b=getNextByte())!=0)
goto LoopBegin;
i++; // found another character
}
यह छोटे-एंडियन के लिए काम करना चाहिए।
केवल अंग्रेज़ी और यूटीएफ -8 के लिए, तार (1) पहले से ही ठीक होना चाहिए। – mouviciel
यदि भाषा कोई फर्क नहीं पड़ता तो आप तारों की उपयोगिता के स्रोत को क्यों नहीं देखते हैं? –