Remove spaces from a variable
I have a variable called 'enteredname':-
var enteredname:String;
When the user enters some text into my text input 'nameentry' and clicks a button the text entered is saved into this variable:-
enteredname = nameentry.text;
This variable is then sent to a server and set as the name of the item the user has added via http request however I want to add in another string variable 'enteredimagename' which will store the same text but will have any spaces removed or any characters that would not be appropriate to an image/jpeg file.
The idea of this is that the user adds a name for an item their adding and the same name gets applied both as the items title and as the items image filename (with all the spaces etc removed) as all of the images in my app are stored on a server and are dynamic so the click would look something like:-
enteredname = nameentry.text;
enteredimagename = nameentry.text (with some code to remove the spaces for this string or something)
Can anyone help me out with this?
Hi use this function pass the name or any string that you want to remove strings..the function will return you the concatenated string without spaces.
private function stripSpaces():String
var strippedSpaces:String = StringUtil.trim(name);
var strArray:Array = strippedSpaces.split(" ");
var concatString:String = "";
for(var i:int=0;i<strArray.length;i++)
if(strArray[i] != " ")
concatString += strArray[i];
return concatString;
This function removes all spaces, also the spaces between words and at the beginning and end as well.
If this post answers your question or helps, please kindly mark it as such.
Thanks,
Bhasker Chari
Similar Messages
-
How to remove space from a variable in a smartform
Hi,
I have a problem in displaying a variable in a smartform..The variable shows some blank space that preceeds the data.
for eg:,
variable = 18.000.
How to remove space before 18.000?To remove the decimal places for quantity and rate/quantity , use the syntax to restrict the number of digits after decimal places. The syntax is
&symbol(.N)&
where N is number of decimal places.
Since you dont want decimals use &symbol(.0)&
For the other case it depends on how the currency is represented , any way try using the syntex &symbol(T)&
Please give me reward point If it is useful
Thanks
Murali Poli -
HT201364 how do i remove space from my start up disk
How do i remove space from my start up disk?
Do you mean "make" space on your HD?
Freeing Up Space on The Hard Drive
1. See Lion/Mountain Lion/Mavericks' Storage Display.
2. You can remove data from your Home folder except for the /Home/Library/ folder.
3. Visit The XLab FAQs and read the FAQ on freeing up space on your hard drive.
4. Also see Freeing space on your Mac OS X startup disk.
5. See Where did my Disk Space go?.
6. See The Storage Display.
You must Empty the Trash in order to recover the space they occupied on the hard drive.
You should consider replacing the drive with a larger one. Check out OWC for drives, tutorials, and toolkits.
Try using OmniDiskSweeper 1.8 or GrandPerspective to search your drive for large files and where they are located. -
Removing spaces from field names?
Hi. I'm using Acrobat 9.3.3.
I use the Form Wizard to create... forms. And a lot of these forms I need to have it do some math calculations -- sums, products, etc. But when I use the Wizard, it auto-creates field names with spaces in them. And (I don't know if this is normal), when I create formulas, notations, scripts, if it's trying to pull from a field with a space in the name it doesn't work.
I have to go in and manually take out the spaces from all the field names... and there can be a lot of fields!
Is there some process I'm not seeing, or some way to configure the Wizard, to remove/prevent spaces in the field names?
Thanks for any info!
LiamI don't believe it is possible.
-
Removing spaces from multiple files
I'm using iWeb to make a photogallery, and when i publish to my server on yahoo, it says there is an error. Now i've had tons of errors and problems with yahoo, and i've come to the conclusion that this problem is because the file names have spaces, and yahoo's servers don't like spaces. So, i was wondering how one would go about removing spaces in file names of multiple files in a folder.
Don't forget that this won't fix any links within the pages themselves.
If you have a link to "some page.html" and the script renames the file 'some_page.html', you'll need to manually update the links in the page to the new file name before the link will work. -
I can not remove spaces from TEXT file..
Hi All,
please advise me why the following code not remove the spaces or tab from the text file.
try
FileReader fr = new FileReader("D:\\Test\\a.txt");
BufferedReader br = new BufferedReader(fr);
Pattern p;
Matcher m;
String line;
String afterReplace = "";
String inputText = "";
while((line = br.readLine()) != null)
inputText = line;
p = Pattern.compile("\\s+|\t");
m = p.matcher(inputText);
System.out.println(afterReplace);
afterReplace = afterReplace + m.replaceAll(" ") + "\r\n";
System.out.println(afterReplace);
fr.close();
catch (Exception e){
System.err.println("Error: " + e.getMessage());
}my regards
Waelmany thanks for you , i try to used it for the following text but the results same.
McNair was shot and killed last weekend in what police say was a murder-suicide. (July 9) Nation / World By: AP
Comments: text ( 0 ) | video ( 0 ) + Add a comment
Be the first to add a comment .
1 2 3 4 5 Your Rating <br>
Popularity Your Name: Your Comment:
http://videos.kansascity.com/vmix_hosted_apps/p/media?id=4999903&item_index=&genre_id=00000840
Your Email: Friend's Email: Your Message:
Top Videos Nation / World
Sports Entertainment Business Lifestyle
Archive User Submitted Politics Ink Local
Selects
all Sort By: Most Recent Most Popular
Highest Rated Loading...
<br>
All users : If you have not already done so, Click "Record a Comment" to begin. Next, click "Allow" to use your camera.<br><br>
Additional Info for Mac users : If you do not see video (after clicking 'allow'), do the following:<br> Click on the blue "gear" icon in the lower right corner to bring up the settings window. Click on the webcam icon. If you are using a built in iSight camera,
choose USB Video Class Video from the pulldown menu. You should see video immediately.<br><br> Click "close" button.
Record! You must record at least ten seconds before
you can stop. -
my itunes shows 119 photos, 4.61 GB, but i have removed many and i only have 44 currently
how do i remove the space it thinks its taking up
thanxHello Linglane4,
You can use the following steps to delet photos from your Camera Roll:
To delete Camera Roll photos and videos from your device
There are two methods to delete items from the Camera Roll:
Import the Camera Roll to your computer and choose to delete items after import.
Delete photos and videos from your device manually:
Open the Photos application and open the Camera Roll.
Tap the Action button.
Tap each photo to select it.
Tap the Delete button.
Note: For photos and videos you want to save, import them to your computer before deleting them from the Camera Roll.
You can find the full article here:
iTunes: Syncing photos
http://support.apple.com/kb/HT4236
Thank you for using Apple Support Communities.
Best,
Sheila M. -
i have a field in a table that stores the email address; this field is manually populated, so almost anything can be put into it; the field is 100 characters long;
one one particular record, someone entered:
"[email protected] [email protected]" into the email address; yes, that is the email address, some spaces and then the email address again;
i have a select statement that gets the first 50 characters of the email address -- "select substr(email_addr,1,50) from employee;"
so what i'm getting is "[email protected] johnathan.washingto", when all i want is "[email protected]";
So what function or trick can i use to get all characters in the email address up to but not including the first space? I thought translate or decode could do it, but i haven't figured it out yet.This forum is for using the "SQL Developer" tool rather than general SQL questions (which is what the "SQL and PL/SQL" forum is for). However, to get what you want, try:
select decode(instr(email_addr, ' '), 0, email_addr, substr(email_addr, 1, instr(email_addr, ' ') - 1)) from employee;
This should work for both where there is a space and where there isn't a space.
theFurryOne -
How to remove space from satrting
help me please
i have 16 digit field , so in output i have only 5 digit and left 11 digit is comming blank
so please tell me how to reduse space form starting
my field is coming like this -- Rs: 78,999.00
so i want to reduse space between Rs and amount
thanksyou can either use condense statement
condense <field name>.
You can also use the following function module.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
INPUT = <FIELD NAME>
IMPORTING
OUTPUT = <FIELD NAME>. -
How to unset or remove ORACLE_HOME from PATH variable in UNIX
Hi,
below is my PATH on one of the server :
oracle@bccdb1d[DUMMY] /optware/sybase/work/jaya => echo $PATH
/optware/oracle/10.2.0.2_Q407/bin:.:/usr/local/bin:/usr/bin:/usr/sbin:/usr/ccs/bin:/opt/FXboks/bin
Now I don't want the ORACLE_HOME path to be there in $PATH. I tried below steps to unset it but wasn't successful:
oracle@bccdb1d[DUMMY] /optware/sybase/work/jaya => export ORACLE_HOME=''
oracle@bccdb1d[DUMMY] /optware/sybase/work/jaya => echo $PATH
/optware/oracle/10.2.0.2_Q407/bin:.:/usr/local/bin:/usr/bin:/usr/sbin:/usr/ccs/bin:/opt/FXboks/bin
Now even after unsetting it I still see the ORACLE_HOME within the PATH variable.
Need help.
Thanks,
Kalyaneither edit your .profile in your home location...vi .profile --this will then be in effect each and every time you login
or make a new profile that you can use such as vi .temp_profile - and then add what ever variables you want to take effect and then execute the profile eg. <. .temp_profile> --this will allow you to choose how you want the $PATH variable to react
or you can reset just the path to what you want by doing: export PATH=<what ever you want listed in your path variable> --this will need to be done each time after logging in -
11g installation warning - how to remove OH from PATH
Hi all,
I am getting the following warning when installing 11g on linux 4.0.
I am using the same Oralce Base where 10g is installed.
Please let me know how I can remove Oralce_home from PATH variable..
Checking PATH environment variable...
Check complete. The overall result of this check is: Failed <<<<
[b]
Problem: The installer has detected that the PATH environment variable includes other ORACLE_HOME locations in it.
Recommendation: Restart the installer after removing other ORACLE_HOME locations from PATH environment variable.
========================================================
Checking LD_LIBRARY_PATH environment variable...
Check complete. The overall result of this check is: Failed <<<<
Problem: The installer has detected that environment variable LD_LIBRARY_PATH includes other ORACLE_HOME locations in it.
Recommendation: Restart the installer after removing other ORACLE_HOME locations from LD_LIBRARY_PATH environment variable.
========================================================
Thanks,What operating system are you on?
Okay, assuming unix of some sort and not Windblows...
This is a nice trick I figured out long ago and is how I am able to easily run multiple versions of oracle with multiple Oracle_Homes on the same servers (unix):
You can easily set your path in your .profile, or .bash_profile, or .cshrc (ugh).
# Set up the PATH <jww>
PATH=$HOME:.:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/bin/X11:/usr/contrib/bin
export PATH
echo $PATH > $HOME/ORIGINAL_PATH
Then..... (here's the main part)
I set up a case script that I accept input based on the ORACLE_SID, which then executes (sources) an oraenv file (of sorts). This file then sets the path for the database based on instance name and version of software requirements.
#!/bin/ksh
# orcl
export ORACLE_SID=orcl
export ORACLE_BASE=/u01/oracle/product
export ORACLE_HOME=$ORACLE_BASE/10.2
export ORAENV_ASK=NO
alias admin='cd /u01/oracle/product/admin'
export NLS_LANG=AMERICAN_AMERICA.AL32UTF8
#Set up the PATH environment
ORIGINAL_PATH=`cat $HOME/ORIGINAL_PATH`
PATH=$ORACLE_HOME/bin:$ORACLE_HOME/ldap/bin:$ORACLE_HOME/Apache/Apache/bin:$ORIGINAL_PATH
## adding the following parameters required for certain oracle utilities (wallet, sqlldr, etc.)
# jww, 01/08/2008
## for Oracle 10G
export LD_LIBRARY_PATH_64=$ORACLE_HOME/lib:/usr/lib
export LD_LIBRARY_PATH=$ORACLE_HOME/lib32
## According to Oracle NOTE: 418548.1
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
echo ""
echo " Verifying environment variables set properly: "
echo " ============================================= "
env |grep 'ORACLE_SID' | grep -v '$ORACLE_SID'
env |grep 'ORACLE_BASE'
env |grep 'ORACLE_HOME'
echo ""
Hope this helps...
Ji Li -
Sorry for asking a very simple (hopefully) question. Does anyone know how can remove spaces from a given field. One of my field has the following:
field1 = ' ABCD'.
What command should I use so field1 would end up with just 'ABCD'?
Thanks.Hi SS
General templates for doing such operations on strings:
SHIFT <c> LEFT DELETING LEADING <str>.
SHIFT <c> RIGHT DELETING TRAILING <str>.
where str can be SPACE or something like e.g: 'abc'
Regards
Ashish -
Removing spaces in column names
Hi
I have imported a number of tables from a legacy db. The column names in tables have spaces in them. Is there a script I can run to remove spaces from column names in all tables?
Thanks
RegardsFirst of all, I do not agree with the concept of changing the column names. There is a good chance of breaking your code, if the table has been referred in procs/functions etc.
One good method would be, import the tables from legacy db into staging and then insert into your actual tables by mapping the tables correctly where your actual table would not have the [space].[Here, I assume your procs/functions etc refer only your actual
tables not staging tables].
OR, if you are looking for a plain logic, then use the below:
The below script wont execute the change, but just would give the statements to be executed to make the column modifications. This is intentional, because this is not a good practice and you can verify the objects and scripts rather than executing it directly.
create table test_table([column test space] int)
--select * From test_table
--Script to do the change in column name
select 'EXEC sp_rename '''+ B.name+'.'+a.name +''', '''+replace(a.name,' ','') +''', ''COLUMN''' from sys.columns A
Inner join sys.tables B on A.object_id = B.object_id and OBJECTPROPERTY(b.object_id, N'IsUserTable') = 1
where
system_type_id in
(select system_type_id From sys.types ) and charindex(' ',a.name)<>0
EXEC sp_rename 'tbl_apas_t_tech.application id', 'applicationid', 'COLUMN'
EXEC sp_rename 'test_table.column test space', 'columntestspace', 'COLUMN'
Drop table test_table
EDIT: Formatting... -
Help :how to remove spaces in string
could any body please help me in removing spaces from string suppose i have written vivek chhabra and i want to remove spaces in this string and want a string vivekchhabra then how this could be done
anybody help me please
vivekString string = "Hello - This is a test!";
String result = string.replaceAll(" ", "");
System.out.println(result);This code results the following output:
Hello-Thisisatest! -
How to remove empty space from a file
Hi all,
Can any one help on how to remove the blank spaces from a file.
I used trim function but unable to remove the spaces.
I have a file in which there is a name like 'JAIRAM' and am storing this file in a variable FILE_CONTENTS.
Now am unable to compare FILE_CONTENTS with another value as it is storing empty spaces also from the file.
Please help on this
Thanks,
SriniTrim only trim at the beginning or at the end. Can you try using the replace sql function.. see below..
SQL> select replace('abc def',' ','') from dual ;
REPLAC
abcdef
cheers
Maybe you are looking for
-
How to wipe MacBook Pro without install disk
I bought a new MacBook Pro that did not come with an installation disk. It came fully loaded brand new. I then was involved with an Internet Microsoft scam and need to delete all files and "start over" - I can not find a way to wipe my hard drive w
-
I am having a problem with connecting my Z10 to my laptop via usb. The laptop is running windows 7 x64 When i connect the phone to the computer via usb i would get a note saying the drivers were not successfully installed. In device manager it would
-
Identify how the Email Alert getting triggered
Hi All, Whenever we are executing a transfer action involving change in position the user is receiving an email stating his address has been changed even-though the address of the employee is not modified.We suspect it is the change in Home Org ID in
-
Filtering keywords in hierarchies ..
Good day! There is an interesting question .. A simplified formulation of the problem: The keyword top-level "Country", there are two offspring "England", "Korea". "Country" *** "England" *** "Korea" There are 10 photos marked key word "England", 20
-
Select count(*) where exists (takes 5 hours).
Hello Gurus, I have two databases on two servers, I am counting how many rows are similiar on two tables that are identical, and the rows should be identical as well. I am running a select count(*) where exists query and it takes 5 hours to complete.