PSeInt SubCadena: take part of a text
Takes a piece out of a text, from one position to another (both included).
- Group:
- String Functions
- Template
SubCadena
Opens the editor with this example loaded. Run it step by step and watch the flowchart.
Worked example
A complete algorithm, ready to copy and run.
Algoritmo Example Escribir SubCadena("pseudocodigo", 1, 6)FinAlgoritmoOutput
Shows: pseudo
This is what the console shows when the example runs.
pseudoCommon mistake
Depending on the profile, the first letter is at position 1 or 0.
Some details depend on your school's profile. See the language profiles.
In a flowchart
This is how it appears in a flowchart, with the same shapes Codoritmo draws.
Template
The general form. Replace what's inside < > with your own data.
SubCadena(<cadena>, <inicio>, <fin>)Examples that use it
Programs from the example library where it appears, from the simplest to the most complete.
Name Initials
Gets the initials of a full name.
BeginnerPalindromes
Checks whether a phrase reads the same forwards and backwards.
IntermediateCount Vowels
Counts the vowels, spaces and other characters in a text.
IntermediateData Formatting
Fixes upper and lower case, and converts between text and numbers.
IntermediateReusable Validation
Validates the email and age on a sign-up form.
IntermediateCaesar Cipher
Encrypts a message by shifting each letter of the alphabet.
Advanced
More string functions
Codoritmo is an independent, open-source project inspired by PSeInt and compatible with its syntax. It is not affiliated with the PSeInt project. Official PSeInt website.