Difference between revisions of "Z3/Z3Clarifications"

From ZCubes Wiki
Jump to navigation Jump to search
(Created page with "==Z3 Clarifications== * << Z3 Home * Z3 Language Documentation List clarifications required on Z3")
 
m
Line 5: Line 5:
  
 
List clarifications required on Z3
 
List clarifications required on Z3
 +
 +
# How do we get a subset of a string value without using loop
 +
 +
Ans:
 +
 +
word = "CORPORATION";
 +
vowels ="AEIOU";
 +
vowelsarray=vowels.split("");
 +
----------------------------------------------------------------------------------------
 +
wordletterswithoutvowels=word.split("").filter((x)=>!x.isin(vowelsarray));
 +
OR
 +
IsNotAVowel:=!x.isin(vowelsarray);
 +
word.split("").filter(IsNotAVowel);
 +
OR
 +
IsNotAVowel:=!x.isin("AEIOU".split(""));
 +
word.split("").filter(IsNotAVowel);
 +
 +
Result => CRPRTN
 +
-----------------------------------------------------------------------------------------

Revision as of 06:19, 25 August 2016

Z3 Clarifications

List clarifications required on Z3

  1. How do we get a subset of a string value without using loop

Ans:

word = "CORPORATION"; vowels ="AEIOU"; vowelsarray=vowels.split("");


wordletterswithoutvowels=word.split("").filter((x)=>!x.isin(vowelsarray)); OR IsNotAVowel:=!x.isin(vowelsarray); word.split("").filter(IsNotAVowel); OR IsNotAVowel:=!x.isin("AEIOU".split("")); word.split("").filter(IsNotAVowel);

Result => CRPRTN