[FREE] StringFunctions Extension - My First Extension!

Version - 1
Release date - 25 January, 2021

Write a short description

This is my first extension! This extension provides various methods to help you work with strings. It has 19 blocks. The function names are real functions in the Python programming language (but in lowercase). You can learn these python functions by using these blocks :stuck_out_tongue_winking_eye:

Add a picture of all the blocks

Documentation

blocks (36)

ErrorOccurred
It is called whenever an error occurs. Use the error variable to know what the error is.


blocks (56)

AllIndex
Returns the index of all the occurrences of a string - piece in another string - text.
Example: text = Good morning everyone, hello everyone? | piece = everyone returns [14, 30].


blocks (37)

Capitalize
Capitalizes the first letter of a string - text.
Example: "text = hello, how are you?" returns Hello, how are you?.


blocks (38)

Count
Counts the number of occurrences of a string - piece in another string - text.
Example: text = I like mangoes, do you like mangoes? | piece = mangoes returns 2.


blocks (39)

EndsWith
Tells whether a string - text ends with another string - piece.
Example: text = I know how to code! | piece = code! returns true.


blocks (40)

Index
Returns the index of the first occurrence of a string - piece in another string - text.
Example: text = Good morning everyone, hello everyone? | piece = everyone returns 14.


blocks (41)

IsAlpha
Tells whether a string - text consists of only letters.
Example: text = 1, 2, 3 are numbers returns false.


blocks (42)

IsAlphaNumeric
Tells whether a string - text consists of only letters and numbers.
Example: text = Hello, 1 is the best! returns false.


blocks (43)

IsDigit
Tells whether a string - text consists of only numbers.
Example: text = 123 returns true.


blocks (44)

IsLower
Tells whether a string - text is all lowercase.
Example: text =hello returns true.


blocks (45)

IsTitle
Tells whether a string - text is in the form of a title (Only the first letter of every word capitalized).
Example: text = The Book Of Light returns true.


blocks (46)

IsUpper
Tells whether a string - text is all uppercase.
Example: text = HELLO returns true.


blocks (47)

Join
Joins a list of strings - texts with a string - joiner.
Example: texst = [hello, how, are, you] | joiner = a returns helloahowaareayou.


blocks (48)

LStrip
Removes spaces from the left of a string - text.
Example: text = "          Hello!" returns Hello!.


blocks (49)

Partition
Breaks a string - text into three parts at the first occurrence of a string - piece and returns a list of the three parts. The three parts are the text before the piece, the piece and the text after the piece
Example: text = We all should eat fruits as they are healthy | piece = fruits returns [We all should eat , fruits, as they are healthy].


blocks (50)

RIndex
Returns the index of the last occurrence of a string - piece in another string - text.
Example: text = Good morning everyone, hello everyone? | piece = everyone returns 30.


blocks (51)

RPartition
Breaks a string - text into three parts at the last occurrence of a string - piece and returns a list of the three parts. The three parts are the text before the piece, the piece and the text after the piece
Example: text = We all should eat healthy fruits and healthy vegetables | piece = healthy returns [We all should eat healthy fruits and , healthy, vegetables].


blocks (52)

RStrip
Removes spaces from the right of a string - text.
Example: text = "Hello!       " returns Hello!.


blocks (53)

Title
Converts a string - text into the title form (Only the first letter of every word capiatlized).
Example: text = the book of light returns The Book Of Light.


Some extra info

All indexes start from 1.
Every method returns error if an error occurs.

Download link

Direct Download - com.sumanyu.StringFunctions.aix (27.3 KB)

Thanks to everybody who helped me in the community with my questions!

I hope you like this extension, if so please leave a like!
If you have any suggestions, do tell me!

10 Likes

Nice extension @Pythony. :smiling_face_with_three_hearts: :smile: :partying_face:

Thank you!

1 Like

It would be nice if you add a upercase and lovercase option. :wink:

Try making it return a list with 2 values
Value 1=14
Value 2=21

1 Like

Those are already in AI2.

blocks (54)

Upcase for making uppercase and downcase for making lowercase.

Thanks for the suggestion!

I have added a new block - AllIndex.

I think it's time to change this word as u

:clap: :clap: :clap:

I just asked

Wow, Really Nice And Useful Extension @Pythony :star_struck: :kissing_heart:
I Love It :heart:
Good Job :sunglasses: :+1:

Thank you!

Thank you!!!

Cool! How did you build an extension in Python? I thought this was only possible in Java. Please share!

I think you have misunderstood, he meaning all the functions in this extension are also there in Python.

Yes, as @KUMARASWAMY_B.G said I built it in java but the function names are that of the functions in python.

3 posts were split to a new topic: How to add an extension