FANDOM


OverviewEdit

This is the strLib documentation. strLib does not have an home page yet. You can download it from: this topic in a Gambas italian forum.

System requirementsEdit

strLib is written with Gambas 2.8. I didn't test it with any earlier versions. Also, strLib has only been tested with GNU/Linux. Should work with any other system supported by Gambas, but... who knows?

The only requested module is gb. You can use strLib in a command-line application.

LicenseEdit

0.0.1 and 0.0.2 versions were released under GNU GPL version 3. I forgotten that the library can be used for www applications. 0.0.3 is release under GNU AGPL version 3.

The difference is that if one uses program, he ALWAYS has the right to get its source; even if he's using it via web browser. GPL doesn't specify this. This is why public web applications with GPL license are not free software.

This documentation is public domain. It doesn't have a license or an owner. Do anything you want with it, I don't care.

CreditsEdit

Author's email is: federico_raz _AT_ yahoo ,. DOT it

Please, feel free to write me; I'll probably feel free to ignore you.

What to do if you find a bugEdit

If the bug is in the library and you can fix the bug
  1. Fix the bug.
  2. Send me the correct function.
  3. Thanx. Now you are a better person.
If the bug is in the lib and you can't fix the bug
  1. Copy your code into an email. Include all that is needed to make your code work. If you don't, I'll insult you.
  2. Tell me exactly what results you would expect.
  3. Tell me exactly what results you get on your system.
  4. Thanx. Now you are a better person.
If the bug is in this docs
  1. Edit the docs. In case you didn't notice, this is a wiki :)
  2. Thanx. Now you are a better person.
If it is a feature request (not a bug)
  1. When you see a comet, desire that I'll implement it. Remember: you don't have to tell your desire to anyone.
  2. Thanx. Now you are a better person.

UsageEdit

FunctionsEdit

The following is a list of all implemented functions.

Infos about string
  • StartsWith()
  • EndsWith()
  • WordsCount()
String Manipulation
  • Implode()
  • Reverse()
  • LeftPad(), RightPad(), Pad()
  • InPad(), OutPad()
  • Fill()
  • Translate()
Case manipulation
  • ICase()
  • UCWords()
  • UCFirst()
Get substring
  • CharAt()
  • CharFromLast()
  • Substring()
Substring manipulation
  • Insert()
  • Drop()
  • SubReplace()
Databases
  • SqlQuote()

Below, they are listed alphabetically.


CharAtEdit

Syntax
String CharAt(String Input, Integer Position)

Returns a character from Input placed at Position. Position is an index starting from 0.

Examples
CharAt("Ravachol", 0) ' returns "R"
CharAt("Ravachol", 1) ' returns "a"

CharFromLastEdit

Syntax
String CharFromLast(String Input, Integer Position)

Returns a character from Input placed at Position. Position starts from 0, which represents the last character.

Examples
CharFromLast("Ravachol", 0) ' returns "l"
CharFromLast("Ravachol", 1) ' returns "o"

DropEdit

Syntax
String Drop(String Input, Integer Start[, Variant End])

Drops from Input a substring and returns it. The substring's first character is pointed by Start and the last character is pointer by End. Both Start and End start from 0. If End is not specified or null, it points to the last character.

Examples
Drop("i don't like you", 2, 7) ' returns "i like you"
Drop("0123456789", 5) ' returns "01234"
Drop("0123456789", 5, NULL) ' returns "01234"
Drop("0123456789", 0) ' returns ""
s = "i don't want to hurt you"
s2 = "don't"
s3 = " hurt"
s = Drop(s, InStr(s, s2) - 1, InStr(s, s3) - 1)
' returns "i hurt you"

FillEdit

Syntax
String Fill(Integer Length, String Pattern)

Returns a string long Length characters, made with characters from Pattern.

Examples
Fill(10, "NO ") ' returns "NO NO NO N"
Fill(1, "ABCDE") ' returns "A"

ICaseEdit

Syntax
Strign ICase(String Input)

Returns Input with all lower case letters turned to upper case and vice versa.

Examples
ICase("HI THERE!") ' returns "hi there!"
ICase("hello world") ' returns "HELLO WORLD"
ICase("Nowhere Man") ' returns "nOWHERE mAN"

ImplodeEdit

I have to redo this. Please, ignore it. It's definitely useless now.

InPadEdit

InsertEdit

LeftPadEdit

LevenshteinEdit

EndsWithEdit

OutPadEdit

PadEdit

ReverseEdit

ReverseSoundexEdit

RightPadEdit

SqlNameEdit

SqlQuoteEdit

StartsWithEdit

SoundexEdit

Soundex4Edit

SoundsLikeEdit

SubReplaceEdit

SubStringEdit

TranslateEdit

UCFirstEdit

Syntax
String UCFirst(String Input)

Returns Input with the first character turned to upper case. Other characters are left unchanged.

Examples
UCFirst("supercalifragilistic") ' returns "Supercalifragilistic"
UCFirst("ETA) ' returns "ETA"

UCWordsEdit

SintaxEdit

String UCWords(String Input)

Returns Input with the first characters turned to upper case in each word. Other characters are left unchanged.

ExamplesEdit

UCWords("welcome to gambas") ' returns "Welcome To Gambas"

UCWords("WELCOME TO GAMBAS") ' returns "Welcome To Gambas"

WordsCountEdit

The past and the futureEdit

ChangeLogEdit

0.0.4Edit

  • Soundex()
  • Soundex4()
  • ReverseSoundex()
  • SoundsLike()
  • Levenshtein()
  • SqlName()

0.0.3Edit

  • License is now AGPL v3
  • ICase()
  • UCWords()
  • UCFirst()
  • Insert()
  • Drop
  • SubReplace()
  • SqlQuote()

0.0.2Edit

  • CharFromLast() was the same as CharAt(). Now, it does what docs say.
  • Substr() and Repeat$() were removed, because Gambas already has these features. Implode() will be modified.
  • CharAt() is faster
  • Pad(), LeftPad(), RightPad() added
  • WordsCound() added

0.0.1Edit

  • This version exist. Previous version didn't. In other words, this is the first version. It doesn't include the version number.

To-DoEdit

  • strLib should become a component
  • More presentation (esthetic) functions.
  • More functions to build Sql statements.
  • Something useful for web applications.

Of course I won't implement these tomorrow, because I'm busy and lazy.

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.