44 Replies
huh?
this function remove last symbol in my string, instead i would like to clone it / copy the last symbol of string. How can i do that?
what do you mean "clone it/copy it?
i want to use the last symbol again for ekvation
f.e
lastnumber - 5
so
ccal
is a string here, right?
?
yes
var last = ccal[^1];
^1 is correctis it ^1 or ^0?
k
^0 is oob
I've had virtually 0 opportunity to use that syntax since it was added
Pobiega#2671
REPL Result: Success
Result: char
Compile: 461.186ms | Execution: 38.873ms | React with ❌ to remove this embed.
"clone" and "copy" are very much not the words to use for this
im getting red under ^1
are you using an old .NET version?
the latest
nvm
You could still have picked .net framework during project creation, even if you made it a day ago.
whats the latest?
.NET 7
how do i check
open your .csproj file
CS8370 Feature 'index operator' is not available in C# 7.3. Please use language version 8.0 or greater. C
Yeah you are 100% using .net framework.
thats the error code i got, cant find my .csproj
are you using visual studio 2022?
yes
$newproject
When creating a new project, prefer using .NET over .NET Framework, unless you have a very specific reason to be using .NET Framework.
.NET Framework is now legacy code and only get security fix updates, it no longer gets new features and is not recommended.
https://cdn.discordapp.com/attachments/569261465463160900/899381236617855016/unknown.png
you picked one of the "NO" options
is there a solution to it
Create a new project and copy your stuff over
most of it will likely work with little changes, since its a new project and you are still a beginner
will try
Does it matter which i choose
6
.net 6
can i just copy and paste over the folder and files for it to work?
no
only the .cs files
ok
would this be right for doing power of 2 on the last number
no because
llcal
will be a char
is there a way to remove first instead of last?
remove or copy?
i got ^2 working but i need to remove
when i 5^2
i get 525
because i havent removed 5
?
can u elaborate
nvm got it working, thx