c#


Encode filename spacebars for browser (CS)


I have a button that starts uploading a filename that has Spaces.
Firefox fails to use this name, its OK for IE.
How to encode spaces to underlines with csharp?
The String.Replace(char, char) method, thus:
string filename = "This is an example";
string encodedFilename = filename.Replace(' ', '_');
Console.WriteLine(encodedFilename);
Produces "This_is_an_example".
Try this:
String safeFileName = fileName.Replace(" ", "_");

Related Links

How to display 2 sets of data on the same axis of ASP.NET chart
Where does the data get stored in Android (Using Xamarin) if there is no DB linked to it?
C# Type Troubles - WPF Controlling a Main Window
Output each Property as XElement
IdentityServer 4 and pre-existing SQL server databases
How to modify sqlite db file located in application folder [duplicate]
Optimize Excel Reading - DataRows into custom Objects
How to follow an event or find all its consumers?
Can I trigger an event in XAML when a control is less than a certain height?
Asynchronously calling asynchronous delegate?
EF6, lazy loading not working as expected
Basic Authentication appears to have no security header
variable and textbox mapping in c# without using textbox changed event
How could I get a Relative Entity's count using EF6
Error1 'WindowsFormsApplication1.Form4' does not contain a constructor that takes 2 arguments'
Environment.MachineName is cropped to 15 characters [duplicate]

Categories

HOME
qlikview
gcc
azure-active-directory
gsm
service
grpc
abc
mediarecorder
travis-ci-cli
rethinkdb
annyang
ionic-native
google-app-maker
core-data
tracking
pylint
airbnb
aiml
gpo
hl7-fhir
gomobile
git-branch
monad-transformers
include-path
typedef
onclicklistener
bootstrap-accordion
ppp
rollupjs
boosting
kundera
folder
paper-trail-gem
apm
language-detection
ng2-bootstrap
storefront
snapkit
ports
imageprocessor
fastadapter
http-proxy
cocoa-scripting
extern
dotnetnuke-module
ngrok
directadmin
autodesk-data-management
bzip2
wufoo
risc
ocamlbuild
remap
hdpi
evaluation
history
sharpdevelop
xamarin-test-cloud
chain
vertex-shader
portaudio
gevent
papyrus
settext
hdr
bytearray
3d-rendering
razorengine
skbio
cascading
tvp
javapackager
edgar
notice
adempiere
winforms-interop
page-refresh
jeet-grid
pysvn
caption
xcode5
sync
ccmenuitem
rpt
nomachine
mobile-robots
pechkin
outlook-object-model
pymel
string-length
tasklist
ios6-maps
flatten
idtabs
openwrap
soapexception
sipdroid
nbehave
web-search
coderush-xpress
onresize
hotfix
urlscan

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App