-
Quotation Marks in a String
Time for my first post, after years of browsing for answers. Let’s dive in.
I’m parsing through text and turning each character into a number value on a slider (this is a small part of a very large portion of code, but that at least provides context), and I’m running into trouble matching ” and ‘ this way. I’ve tried to separate it by adding the backslash (\), but to no avail. Simply triple quoting (“””) returns an error and disables the expression. I can single double single (‘ ” ‘), which does not return an error, but also doesn’t match.
So, does anyone know what I’m missing here? I figured those two would give me trouble as they are special characters.
Thanks, for helping me here and many years before, even though you didn’t know it.
textVal = thisComp.layer("Evaluate").text.sourceText;
slideVal = effect("Chicklet_Value")("Slider");
textLength = thisComp.layer("Type Words").text.sourceText.length;
offsetVal = Math.floor(linear(time, 0, (timeSlider+.5), 0, textLength))if (offsetVal == textLength){
slideVal = 0}
else if (textVal == "a"){
slideVal = 1}
else if(textVal == "b"){
slideVal = 2}
else if(textVal == "c"){
slideVal = 3}
...
...
else if(textVal == """){
slideVal = 47}
else{
slideVal = 0}