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 BenouKat · Oct 16, 2012 at 10:29 AM · wwwstringloadfilepath

How to supress a # into a path string

I try to load a file with WWW : the problem is one folder of the file got a "#" in his name.

How could i supress it ? I already try "@" before my string variable named "path" like this :

WWW www = new WWW("file://" + @path);

and it didn't work. Any idea ?

Comment
Add comment · Show 1
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 fafase · Oct 16, 2012 at 01:08 PM 0
Share

Have you tried String.Trim? http://msdn.microsoft.com/en-us/library/d4tt83f9.aspx

1 Reply

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

Answer by Kryptos · Oct 16, 2012 at 12:52 PM

URL can only contains alphanumeric characters. "#" is considered a special character.

Two solutions:

  1. Rename the folder. It is not standard to have a "#" in a path name.

  2. Encode the "#" character so that it fits the urlencoded standard, in this case %23. For that purpose, you can use WWW.EscapeURL().

Comment
Add comment · Show 3 · 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 BenouKat · Oct 16, 2012 at 01:38 PM 0
Share

Thanks a lot :)

avatar image Kryptos · Oct 16, 2012 at 01:39 PM 0
Share

You're welcome. Also note @fafase comment: String.Trim can be useful when you want to remove a particular character from a string.

avatar image BenouKat · Oct 16, 2012 at 01:46 PM 0
Share

Yep but if i "remove" character, it's a problem when i try to access the folder because the folder with this name doesn't exist (obviously). But i take the first solution : Rename all crappy folder with a #.

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

11 People are following this question.

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

Related Questions

Return name of file only 1 Answer

Can't find texture file path using Resources.Load() 1 Answer

Can you load an AudioClip from the file system w/o using WWW? 0 Answers

Read dialog text from text file in javascript 0 Answers

OBB. How I can access files in OBB? 0 Answers


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