Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by AlucardJay · Jul 27, 2012 at 02:51 PM · javascriptstringparser

Remove TAB from parsed string

This is a new problem arising from my previous question : http://answers.unity3d.com/questions/291294/stringequals-not-working-as-expected.html

I am reading a texture packer text info file, and after removing \r \n and space , the file still shows spaces, and this is confirmed when the string is split.

How do I remove the Tabbed space from a string using String.Replace(" TAB ", ""); ?

e.g. a Debug returns Debug.Log( "tempBulk = " + tempBulk );

returns tempBulk = "frames""background.png" SPACE "frame""x"2,"y"2,"w"480,"h"320, SPACE "rotated"false, SPACE "trimmed"false, "

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Seth-Bergman · Jul 27, 2012 at 04:09 PM 1
Share

have you tried "\\t" ?

http://www.w3schools.com/js/js_special_characters.asp

avatar image AlucardJay · Jul 27, 2012 at 04:19 PM 0
Share

No, and thankyou very much, tested and working ! I just learned of \r tonight while doing this. Great link, please post this as an answer

2 Replies

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by Seth-Bergman · Jul 27, 2012 at 04:21 PM

have you tried "\\t" ?

http://www.w3schools.com/js/js_special_characters.asp

hey....

I finally got one

WOOT!

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image AlucardJay · Jul 27, 2012 at 04:32 PM 0
Share

And I can't tell ya how happy I am also for it . Nice job =]

avatar image Bunny83 · Jul 27, 2012 at 10:10 PM 0
Share

Btw. The backslash-escape characters are the same in most languages. Since they are all c-style languages, just see:

http://en.wikipedia.org/wiki/C_syntax#Backslash_escapes

avatar image
1

Answer by Bunny83 · Jul 27, 2012 at 09:17 PM

Why don't you use a JSON parser? I've written a very simple and small but powerful parser:

SimpleJSON

When you want to use it from UnityScript you have to place it in "Assets/Plugins/".

Here's a example file for UnityScript

And here the same example in C#

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image AlucardJay · Jul 27, 2012 at 11:05 PM 0
Share

Too funny. I just spent all night working and then answered the question that prompted my motivation to do this (I have wanted to for a while, since doing a .fnt parser). $$anonymous$$y result : http://answers.unity3d.com/questions/290643/atlas-tool-like-ngui.html

I started by looking at UIToolkit's $$anonymous$$iJSON but didn't understand a line of it.

So is this the point where I break down or start laughing maniacally ?

Thankyou for passing that on and sharing. after a morning nap I shall look right through that, am sure it will help me alot (I would really like to get to the stage where I can do things like this and dictionary's). Thumb Up =]

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

7 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

remove quotation marks from a parsed string 2 Answers

script default variable value behaviour 2 Answers

Array of random loot items inside GUI.window 1 Answer

Combo Script Problem 1 Answer

Array of Array 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges