The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 LabTalk Forum
 .Replace Unicode characters
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

AKazak

Russia
1228 Posts

Posted - 07/12/2022 :  04:08:27 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
OriginPro 2022b (64-bit) SR1 9.9.5.171
Windows 7 Pro SP1 x64

Greetings!

I want to use .Replace to replace "^2" to "" (Unicode Superscript Two, U+00B2). However the following syntaxes fail:
LabelText.Replace("^2", "");


What should I use to solve the task?

Thank you.

---
Andrey

Edited by - AKazak on 07/12/2022 04:12:45 AM

AKazak

Russia
1228 Posts

Posted - 07/12/2022 :  04:14:33 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
The following code works correctly:
LabelText.Replace("^2", "\x(00b2)");


However, how do I replace with "" character instead of \x code?

---
Andrey
Go to Top of Page

cpyang

USA
1406 Posts

Posted - 07/12/2022 :  10:06:56 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Your own solution is the answer. Labtalk code must in ANSI text so unicode cannot be used.

CP
Go to Top of Page

AKazak

Russia
1228 Posts

Posted - 07/12/2022 :  11:06:21 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by cpyang

Your own solution is the answer. Labtalk code must in ANSI text so unicode cannot be used.

CP



OK.
Got it!

---
Andrey
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000