Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

euphoria
methods
communitycreator

What is the proper() method in Euphoria?

NDUKWE CHIDERA K.

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

Overview

In Euphoria, the proper() method is a built-in sequence manipulation method used to capitalize each word arrangement in text file editing.

With the proper() method, we can easily make the first letter of all alphabetic members of a sequence capitalized. We have to make sure that all sequence members are alphabetic characters. If not, the conversion will not happen.

However, if a nested sequence contains a non-alphabetic character subsequence, the function will only affect that subsequence, while the remainder will stay unaffected.

Syntax

proper(value)

Parameters

This method takes the parameter, value, which represents the string value whose words are to be capitalized.

Return value

It returns a sequence whose words have been capitalized.

Requirement

To access this function in our program code, we have to include the text.e file in it.

std/text.e
include std/text.e
--declare some sequence
sequence seq1,seq2, seq3
seq1 = proper("the educative edpresso platform")

seq2 = proper("A PLATFORM FOR BYTE SIZED SHOTS")

seq3= proper("EDUCATIVE EDPRESSO platform for dEPLOYMENT tOpIcs")

printf(1,"\n %s \n %s \n %s",{seq1,seq2,seq3})

Explanation

  • Line 1: We include the text.e file, which allows the method() to be used in the program.

  • Line 2: We declare the sequence variables.

  • Lines 4–8: We call the proper() function to convert the members of a certain sequence, and store them in the variables we declared.

  • Line 10: We use printf() to print the value of seq1, seq2, and seq3.

RELATED TAGS

euphoria
methods
communitycreator

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

Keep Exploring