Blocks
keyboard_arrow_up
Add
Text
Index
-
- String
- Join
- Length
- Is empty?
- Compare texts
- Trim
- Uppercase and Lowercase
- Starts at..
- Contains
- Split text
- Segment
- Replace all
- Obfuscated text
- Is it a String?
-
Blocks Text
- String
- It contains a text string. This string can contain any character (letters, numbers or other special characters). App Inventor will be considered a text object.
- Join
- Add all the entries to make a single string. If there are no entries, returns an empty string.
- Length
- Returns an integer with the number of characters, including spaces in the introduced string.
- Is empty?
- Returns if the string contains any characters (including spaces). When the length of the string is 0, it returns true. Otherwise, it returns false.
- Compare texts
- Returns if the first string is lexicographically different or equal with respect to the second string, depending on which drop-down menu is selected. A 'a' chain considered to be lexicographically greater than another is alphabetically greater than the other string, that is, would be positioned later in the dictionary. All uppercase letters are considered smaller or before lower case letters. By example: cat> Cat or> A lexicographically.
- Trim
- Remove spaces that carry or continue to the input string and returns the result.
- Uppercase and Lowercase
- Uppercase, returns a copy of your text string argument converted to uppercase.
- Lowercase, returns a copy of your text string argument converted to all lowercase.
- Starts at..
- Returns the position of the character where the first appears first character of the piece in the text, or 0 if it is not present. For example, the location of ana < b> in hav ana banana is 4.
- Contains
- Returns true if the piece appears in the text. On the contrary, returns false.
- Split text
- These blocks will allow us to divide the text according to its position, by the character that we choose, for spaces...
- Divide the text into parts using 'in' as the division points and produces a list with the results. Divide "one, two, three, four" into "," (coma). Returns the list {one two three four}. Divide {one potato, two potatoes, three potatoes, four potatoes} in potato ", returns the list one two three four.
- Divide the given text into two parts using the location of the first appearance of 'in' as a dividing point and returns a list of two elements that consists of the piece before the point dividing (the content of 'in') and the piece after the dividing point. Divide "apple, banana, cherry, pear" with a comma as a dividing point, generate a list of two elements: the first is the text "apple" and the second is the text "banana, cherry, pear". We can see that the coma after the apple does not appear in the result, that is because that is, the point of division.
- Divide the text given in a list, of two articles, using the first location of the division point. Divide "I love ap ples ba nanas apples grapes" by the list [ ba, ap ] would result in a list of two articles, the first is {I love} and the second, {ples bananas apples grapes}.
- Divide the given text into a list, using any of the elements in it as a dividing point. Split "appleberry, banana, cherry, dogfood" into 'on (list)', with the value of the first element being this a comma and whose second element is rry, returns a list of four elements: [applebe, banana, che, dogfood,]
- Divide the given text when a space appears, producing a list of the pieces.
- Segment
- Extract part of the text starting at the start position and continuing with the length characters.
- Replace all
- Returns a new text string obtained by replacing all the occurrences of the substring with the replacement one. That is, it replaces everything that is the same as the substring for the replacement. For example, "She loves to eat", if we use "eat" as a segment and "write" as a replacement our text will remain as follows: "She loves to write."
- Obfuscated text
- This is a block of text, the difference with the normal, is that, the text It is not easy to see if you examine the APK of our app, this "obfuscated". This block is used when creating apps with confidential content, such as an API key. Equally this only obfuscates the text, it is not totally protected against experts
- Is it a String?
- It is used to check if the added value is a chain or not, returning true if it is or false if it is not.