Quantcast
Channel: Comments for Gnutiken
Viewing all articles
Browse latest Browse all 10

Comment on String manipulation in bash by dummy

0
0

If you use bash 4.x you can source the oobash. A string lib written in bash with oo-style:

http://sourceforge.net/projects/oobash/

String is the constructor function:

String a abcda

a.indexOf a

0

a.lastIndexOf a

4

a.indexOf da

3

There are many “methods” more to work with strings in your scripts:

-base64Decode -base64Encode -capitalize -center
-charAt -concat -contains -count
-endsWith -equals -equalsIgnoreCase -reverse
-hashCode -indexOf -isAlnum -isAlpha
-isAscii -isDigit -isEmpty -isHexDigit
-isLowerCase -isSpace -isPrintable -isUpperCase
-isVisible -lastIndexOf -length -matches
-replaceAll -replaceFirst -startsWith -substring
-swapCase -toLowerCase -toString -toUpperCase
-trim -zfill

I hope this makes your string mainipulations an easy task..
bye


Viewing all articles
Browse latest Browse all 10

Latest Images

Trending Articles





Latest Images